
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">

	<title>File admin\controller\customer\customer.php | OpenCart API API</title>
	<link rel="stylesheet" href="http://localhost\opencart-master/docs/api/assets/main.css">
	<script src="http://localhost\opencart-master/docs/api/assets/main.js" defer></script>
</head>

<body class="layout">
	<div class="layout-aside">
	<div class="menu">
			<div class="menu-section">
				<h3>Namespaces</h3>
	<ul>
			<li class="menuGroup-item active">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.html">Opencart</a>
	<ul>
			<li class="menuGroup-item active">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.html">Admin</a>
	<ul>
			<li class="menuGroup-item active">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.html">Controller</a>
	<ul>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Catalog.html">Catalog</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Cms.html">Cms</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Common.html">Common</a>
			</li>
			<li class="menuGroup-item active">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Customer.html">Customer</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Design.html">Design</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Error.html">Error</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Event.html">Event</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Extension.html">Extension</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Localisation.html">Localisation</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Mail.html">Mail</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Marketing.html">Marketing</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Marketplace.html">Marketplace</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Report.html">Report</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Sale.html">Sale</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Setting.html">Setting</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Startup.html">Startup</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Tool.html">Tool</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.User.html">User</a>
			</li>
	</ul>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Model.html">Model</a>
			</li>
	</ul>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Catalog.html">Catalog</a>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.html">System</a>
			</li>
	</ul>
			</li>
			<li class="menuGroup-item">
				<a href="http://localhost\opencart-master/docs/api/namespace-none.html">none</a>
			</li>
	</ul>
			</div>

		<div class="menu-section">
			<h3>Classes</h3>
			<ul>
					<li>
						<a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.Address.html">
							Address
						</a>
					</li>
					<li class="active">
						<a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.Customer.html">
							Customer
						</a>
					</li>
					<li>
						<a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.CustomerApproval.html">
							CustomerApproval
						</a>
					</li>
					<li>
						<a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.CustomerGroup.html">
							CustomerGroup
						</a>
					</li>
					<li>
						<a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.CustomField.html">
							CustomField
						</a>
					</li>
					<li>
						<a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.Gdpr.html">
							Gdpr
						</a>
					</li>
			</ul>
		</div>
	</div>
	</div>

	<div class="layout-main">
		<div class="layout-navbar">
	<nav class="navbar">
		<div class="navbar-left">
			<ul class="navbar-links">
				<li>
					<a href="http://localhost\opencart-master/docs/api/index.html">Overview</a>
				</li>
				<li>
					
						<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Controller.Customer.html">Namespace</a>
					
				</li>
<li class="active"><a href="http://localhost\opencart-master/docs/api/Opencart.Admin.Controller.Customer.Customer.html">Class</a></li>				<li>
					<a href="http://localhost\opencart-master/docs/api/tree.html">Tree</a>
				</li>
			</ul>
		</div>
		<div class="navbar-right">
	<div class="search" data-elements="http://localhost\opencart-master/docs/api/assets/elements.js">
		<input class="search-input" placeholder="Search class, function or namespace" autofocus>
		<ul class="search-results"></ul>
	</div>
		</div>
	</nav>
		</div>

		<div class="layout-content">
	<table class="source"><tr id="1" class="source-line"><td><a class="source-lineNum" href="#1">   1: </a></td><td><span class="php-tag">&lt;?php</span></td></tr><tr id="2" class="source-line"><td><a class="source-lineNum" href="#2">   2: </a></td><td><span class="php-tag"></span><span class="php-kw">namespace</span> Opencart\Admin\Controller\Customer;</td></tr><tr id="3" class="source-line"><td><a class="source-lineNum" href="#3">   3: </a></td><td><span class="php-comment">/**</span></td></tr><tr id="4" class="source-line"><td><a class="source-lineNum" href="#4">   4: </a></td><td><span class="php-comment"> * Class Customer</span></td></tr><tr id="5" class="source-line"><td><a class="source-lineNum" href="#5">   5: </a></td><td><span class="php-comment"> *</span></td></tr><tr id="6" class="source-line"><td><a class="source-lineNum" href="#6">   6: </a></td><td><span class="php-comment"> * @package Opencart\Admin\Controller\Customer</span></td></tr><tr id="7" class="source-line"><td><a class="source-lineNum" href="#7">   7: </a></td><td><span class="php-comment"> */</span></td></tr><tr id="8" class="source-line"><td><a class="source-lineNum" href="#8">   8: </a></td><td><span class="php-kw">class</span> Customer <span class="php-kw">extends</span> \Opencart\System\Engine\Controller {</td></tr><tr id="9" class="source-line"><td><a class="source-lineNum" href="#9">   9: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="10" class="source-line"><td><a class="source-lineNum" href="#10">  10: </a></td><td><span class="php-comment">	 * Index</span></td></tr><tr id="11" class="source-line"><td><a class="source-lineNum" href="#11">  11: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="12" class="source-line"><td><a class="source-lineNum" href="#12">  12: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="13" class="source-line"><td><a class="source-lineNum" href="#13">  13: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="14" class="source-line"><td><a class="source-lineNum" href="#14">  14: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> index(): void {</td></tr><tr id="15" class="source-line"><td><a class="source-lineNum" href="#15">  15: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="16" class="source-line"><td><a class="source-lineNum" href="#16">  16: </a></td><td></td></tr><tr id="17" class="source-line"><td><a class="source-lineNum" href="#17">  17: </a></td><td>		<span class="php-var">$this</span>-&gt;document-&gt;setTitle(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;heading_title&#039;</span>));</td></tr><tr id="18" class="source-line"><td><a class="source-lineNum" href="#18">  18: </a></td><td></td></tr><tr id="19" class="source-line"><td><a class="source-lineNum" href="#19">  19: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="20" class="source-line"><td><a class="source-lineNum" href="#20">  20: </a></td><td>			<span class="php-var">$filter_name</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>];</td></tr><tr id="21" class="source-line"><td><a class="source-lineNum" href="#21">  21: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="22" class="source-line"><td><a class="source-lineNum" href="#22">  22: </a></td><td>			<span class="php-var">$filter_name</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="23" class="source-line"><td><a class="source-lineNum" href="#23">  23: </a></td><td>		}</td></tr><tr id="24" class="source-line"><td><a class="source-lineNum" href="#24">  24: </a></td><td></td></tr><tr id="25" class="source-line"><td><a class="source-lineNum" href="#25">  25: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="26" class="source-line"><td><a class="source-lineNum" href="#26">  26: </a></td><td>			<span class="php-var">$filter_email</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>];</td></tr><tr id="27" class="source-line"><td><a class="source-lineNum" href="#27">  27: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="28" class="source-line"><td><a class="source-lineNum" href="#28">  28: </a></td><td>			<span class="php-var">$filter_email</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="29" class="source-line"><td><a class="source-lineNum" href="#29">  29: </a></td><td>		}</td></tr><tr id="30" class="source-line"><td><a class="source-lineNum" href="#30">  30: </a></td><td></td></tr><tr id="31" class="source-line"><td><a class="source-lineNum" href="#31">  31: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="32" class="source-line"><td><a class="source-lineNum" href="#32">  32: </a></td><td>			<span class="php-var">$filter_customer_group_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="33" class="source-line"><td><a class="source-lineNum" href="#33">  33: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="34" class="source-line"><td><a class="source-lineNum" href="#34">  34: </a></td><td>			<span class="php-var">$filter_customer_group_id</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="35" class="source-line"><td><a class="source-lineNum" href="#35">  35: </a></td><td>		}</td></tr><tr id="36" class="source-line"><td><a class="source-lineNum" href="#36">  36: </a></td><td></td></tr><tr id="37" class="source-line"><td><a class="source-lineNum" href="#37">  37: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="38" class="source-line"><td><a class="source-lineNum" href="#38">  38: </a></td><td>			<span class="php-var">$filter_status</span> = (bool)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="39" class="source-line"><td><a class="source-lineNum" href="#39">  39: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="40" class="source-line"><td><a class="source-lineNum" href="#40">  40: </a></td><td>			<span class="php-var">$filter_status</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="41" class="source-line"><td><a class="source-lineNum" href="#41">  41: </a></td><td>		}</td></tr><tr id="42" class="source-line"><td><a class="source-lineNum" href="#42">  42: </a></td><td></td></tr><tr id="43" class="source-line"><td><a class="source-lineNum" href="#43">  43: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="44" class="source-line"><td><a class="source-lineNum" href="#44">  44: </a></td><td>			<span class="php-var">$filter_ip</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="45" class="source-line"><td><a class="source-lineNum" href="#45">  45: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="46" class="source-line"><td><a class="source-lineNum" href="#46">  46: </a></td><td>			<span class="php-var">$filter_ip</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="47" class="source-line"><td><a class="source-lineNum" href="#47">  47: </a></td><td>		}</td></tr><tr id="48" class="source-line"><td><a class="source-lineNum" href="#48">  48: </a></td><td></td></tr><tr id="49" class="source-line"><td><a class="source-lineNum" href="#49">  49: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="50" class="source-line"><td><a class="source-lineNum" href="#50">  50: </a></td><td>			<span class="php-var">$filter_date_from</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="51" class="source-line"><td><a class="source-lineNum" href="#51">  51: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="52" class="source-line"><td><a class="source-lineNum" href="#52">  52: </a></td><td>			<span class="php-var">$filter_date_from</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="53" class="source-line"><td><a class="source-lineNum" href="#53">  53: </a></td><td>		}</td></tr><tr id="54" class="source-line"><td><a class="source-lineNum" href="#54">  54: </a></td><td></td></tr><tr id="55" class="source-line"><td><a class="source-lineNum" href="#55">  55: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="56" class="source-line"><td><a class="source-lineNum" href="#56">  56: </a></td><td>			<span class="php-var">$filter_date_to</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="57" class="source-line"><td><a class="source-lineNum" href="#57">  57: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="58" class="source-line"><td><a class="source-lineNum" href="#58">  58: </a></td><td>			<span class="php-var">$filter_date_to</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="59" class="source-line"><td><a class="source-lineNum" href="#59">  59: </a></td><td>		}</td></tr><tr id="60" class="source-line"><td><a class="source-lineNum" href="#60">  60: </a></td><td></td></tr><tr id="61" class="source-line"><td><a class="source-lineNum" href="#61">  61: </a></td><td>		<span class="php-var">$url</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="62" class="source-line"><td><a class="source-lineNum" href="#62">  62: </a></td><td></td></tr><tr id="63" class="source-line"><td><a class="source-lineNum" href="#63">  63: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="64" class="source-line"><td><a class="source-lineNum" href="#64">  64: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_name=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="65" class="source-line"><td><a class="source-lineNum" href="#65">  65: </a></td><td>		}</td></tr><tr id="66" class="source-line"><td><a class="source-lineNum" href="#66">  66: </a></td><td></td></tr><tr id="67" class="source-line"><td><a class="source-lineNum" href="#67">  67: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="68" class="source-line"><td><a class="source-lineNum" href="#68">  68: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_email=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="69" class="source-line"><td><a class="source-lineNum" href="#69">  69: </a></td><td>		}</td></tr><tr id="70" class="source-line"><td><a class="source-lineNum" href="#70">  70: </a></td><td></td></tr><tr id="71" class="source-line"><td><a class="source-lineNum" href="#71">  71: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="72" class="source-line"><td><a class="source-lineNum" href="#72">  72: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_customer_group_id=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="73" class="source-line"><td><a class="source-lineNum" href="#73">  73: </a></td><td>		}</td></tr><tr id="74" class="source-line"><td><a class="source-lineNum" href="#74">  74: </a></td><td></td></tr><tr id="75" class="source-line"><td><a class="source-lineNum" href="#75">  75: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="76" class="source-line"><td><a class="source-lineNum" href="#76">  76: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_status=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="77" class="source-line"><td><a class="source-lineNum" href="#77">  77: </a></td><td>		}</td></tr><tr id="78" class="source-line"><td><a class="source-lineNum" href="#78">  78: </a></td><td></td></tr><tr id="79" class="source-line"><td><a class="source-lineNum" href="#79">  79: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="80" class="source-line"><td><a class="source-lineNum" href="#80">  80: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_ip=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="81" class="source-line"><td><a class="source-lineNum" href="#81">  81: </a></td><td>		}</td></tr><tr id="82" class="source-line"><td><a class="source-lineNum" href="#82">  82: </a></td><td></td></tr><tr id="83" class="source-line"><td><a class="source-lineNum" href="#83">  83: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="84" class="source-line"><td><a class="source-lineNum" href="#84">  84: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_from=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="85" class="source-line"><td><a class="source-lineNum" href="#85">  85: </a></td><td>		}</td></tr><tr id="86" class="source-line"><td><a class="source-lineNum" href="#86">  86: </a></td><td></td></tr><tr id="87" class="source-line"><td><a class="source-lineNum" href="#87">  87: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="88" class="source-line"><td><a class="source-lineNum" href="#88">  88: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_to=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="89" class="source-line"><td><a class="source-lineNum" href="#89">  89: </a></td><td>		}</td></tr><tr id="90" class="source-line"><td><a class="source-lineNum" href="#90">  90: </a></td><td></td></tr><tr id="91" class="source-line"><td><a class="source-lineNum" href="#91">  91: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>])) {</td></tr><tr id="92" class="source-line"><td><a class="source-lineNum" href="#92">  92: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;sort=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>];</td></tr><tr id="93" class="source-line"><td><a class="source-lineNum" href="#93">  93: </a></td><td>		}</td></tr><tr id="94" class="source-line"><td><a class="source-lineNum" href="#94">  94: </a></td><td></td></tr><tr id="95" class="source-line"><td><a class="source-lineNum" href="#95">  95: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>])) {</td></tr><tr id="96" class="source-line"><td><a class="source-lineNum" href="#96">  96: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;order=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>];</td></tr><tr id="97" class="source-line"><td><a class="source-lineNum" href="#97">  97: </a></td><td>		}</td></tr><tr id="98" class="source-line"><td><a class="source-lineNum" href="#98">  98: </a></td><td></td></tr><tr id="99" class="source-line"><td><a class="source-lineNum" href="#99">  99: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>])) {</td></tr><tr id="100" class="source-line"><td><a class="source-lineNum" href="#100"> 100: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;page=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="101" class="source-line"><td><a class="source-lineNum" href="#101"> 101: </a></td><td>		}</td></tr><tr id="102" class="source-line"><td><a class="source-lineNum" href="#102"> 102: </a></td><td></td></tr><tr id="103" class="source-line"><td><a class="source-lineNum" href="#103"> 103: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;breadcrumbs&#039;</span>] = [];</td></tr><tr id="104" class="source-line"><td><a class="source-lineNum" href="#104"> 104: </a></td><td></td></tr><tr id="105" class="source-line"><td><a class="source-lineNum" href="#105"> 105: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;breadcrumbs&#039;</span>][] = [</td></tr><tr id="106" class="source-line"><td><a class="source-lineNum" href="#106"> 106: </a></td><td>			<span class="php-str">&#039;text&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_home&#039;</span>),</td></tr><tr id="107" class="source-line"><td><a class="source-lineNum" href="#107"> 107: </a></td><td>			<span class="php-str">&#039;href&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;common/dashboard&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>])</td></tr><tr id="108" class="source-line"><td><a class="source-lineNum" href="#108"> 108: </a></td><td>		];</td></tr><tr id="109" class="source-line"><td><a class="source-lineNum" href="#109"> 109: </a></td><td></td></tr><tr id="110" class="source-line"><td><a class="source-lineNum" href="#110"> 110: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;breadcrumbs&#039;</span>][] = [</td></tr><tr id="111" class="source-line"><td><a class="source-lineNum" href="#111"> 111: </a></td><td>			<span class="php-str">&#039;text&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;heading_title&#039;</span>),</td></tr><tr id="112" class="source-line"><td><a class="source-lineNum" href="#112"> 112: </a></td><td>			<span class="php-str">&#039;href&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-var">$url</span>)</td></tr><tr id="113" class="source-line"><td><a class="source-lineNum" href="#113"> 113: </a></td><td>		];</td></tr><tr id="114" class="source-line"><td><a class="source-lineNum" href="#114"> 114: </a></td><td></td></tr><tr id="115" class="source-line"><td><a class="source-lineNum" href="#115"> 115: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;add&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.form&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-var">$url</span>);</td></tr><tr id="116" class="source-line"><td><a class="source-lineNum" href="#116"> 116: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;delete&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.delete&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>]);</td></tr><tr id="117" class="source-line"><td><a class="source-lineNum" href="#117"> 117: </a></td><td></td></tr><tr id="118" class="source-line"><td><a class="source-lineNum" href="#118"> 118: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;list&#039;</span>] = <span class="php-var">$this</span>-&gt;getList();</td></tr><tr id="119" class="source-line"><td><a class="source-lineNum" href="#119"> 119: </a></td><td></td></tr><tr id="120" class="source-line"><td><a class="source-lineNum" href="#120"> 120: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer_group&#039;</span>);</td></tr><tr id="121" class="source-line"><td><a class="source-lineNum" href="#121"> 121: </a></td><td></td></tr><tr id="122" class="source-line"><td><a class="source-lineNum" href="#122"> 122: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;customer_groups&#039;</span>] = <span class="php-var">$this</span>-&gt;model_customer_customer_group-&gt;getCustomerGroups();</td></tr><tr id="123" class="source-line"><td><a class="source-lineNum" href="#123"> 123: </a></td><td></td></tr><tr id="124" class="source-line"><td><a class="source-lineNum" href="#124"> 124: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_name&#039;</span>] = <span class="php-var">$filter_name</span>;</td></tr><tr id="125" class="source-line"><td><a class="source-lineNum" href="#125"> 125: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_email&#039;</span>] = <span class="php-var">$filter_email</span>;</td></tr><tr id="126" class="source-line"><td><a class="source-lineNum" href="#126"> 126: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_customer_group_id&#039;</span>] = <span class="php-var">$filter_customer_group_id</span>;</td></tr><tr id="127" class="source-line"><td><a class="source-lineNum" href="#127"> 127: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_status&#039;</span>] = <span class="php-var">$filter_status</span>;</td></tr><tr id="128" class="source-line"><td><a class="source-lineNum" href="#128"> 128: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_ip&#039;</span>] = <span class="php-var">$filter_ip</span>;</td></tr><tr id="129" class="source-line"><td><a class="source-lineNum" href="#129"> 129: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_date_from&#039;</span>] = <span class="php-var">$filter_date_from</span>;</td></tr><tr id="130" class="source-line"><td><a class="source-lineNum" href="#130"> 130: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;filter_date_to&#039;</span>] = <span class="php-var">$filter_date_to</span>;</td></tr><tr id="131" class="source-line"><td><a class="source-lineNum" href="#131"> 131: </a></td><td></td></tr><tr id="132" class="source-line"><td><a class="source-lineNum" href="#132"> 132: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;user_token&#039;</span>] = <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>];</td></tr><tr id="133" class="source-line"><td><a class="source-lineNum" href="#133"> 133: </a></td><td></td></tr><tr id="134" class="source-line"><td><a class="source-lineNum" href="#134"> 134: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;header&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/header&#039;</span>);</td></tr><tr id="135" class="source-line"><td><a class="source-lineNum" href="#135"> 135: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;column_left&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/column_left&#039;</span>);</td></tr><tr id="136" class="source-line"><td><a class="source-lineNum" href="#136"> 136: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;footer&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/footer&#039;</span>);</td></tr><tr id="137" class="source-line"><td><a class="source-lineNum" href="#137"> 137: </a></td><td></td></tr><tr id="138" class="source-line"><td><a class="source-lineNum" href="#138"> 138: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer&#039;</span>, <span class="php-var">$data</span>));</td></tr><tr id="139" class="source-line"><td><a class="source-lineNum" href="#139"> 139: </a></td><td>	}</td></tr><tr id="140" class="source-line"><td><a class="source-lineNum" href="#140"> 140: </a></td><td></td></tr><tr id="141" class="source-line"><td><a class="source-lineNum" href="#141"> 141: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="142" class="source-line"><td><a class="source-lineNum" href="#142"> 142: </a></td><td><span class="php-comment">	 * List</span></td></tr><tr id="143" class="source-line"><td><a class="source-lineNum" href="#143"> 143: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="144" class="source-line"><td><a class="source-lineNum" href="#144"> 144: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="145" class="source-line"><td><a class="source-lineNum" href="#145"> 145: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="146" class="source-line"><td><a class="source-lineNum" href="#146"> 146: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> list(): void {</td></tr><tr id="147" class="source-line"><td><a class="source-lineNum" href="#147"> 147: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="148" class="source-line"><td><a class="source-lineNum" href="#148"> 148: </a></td><td></td></tr><tr id="149" class="source-line"><td><a class="source-lineNum" href="#149"> 149: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getList());</td></tr><tr id="150" class="source-line"><td><a class="source-lineNum" href="#150"> 150: </a></td><td>	}</td></tr><tr id="151" class="source-line"><td><a class="source-lineNum" href="#151"> 151: </a></td><td></td></tr><tr id="152" class="source-line"><td><a class="source-lineNum" href="#152"> 152: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="153" class="source-line"><td><a class="source-lineNum" href="#153"> 153: </a></td><td><span class="php-comment">	 * Get List</span></td></tr><tr id="154" class="source-line"><td><a class="source-lineNum" href="#154"> 154: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="155" class="source-line"><td><a class="source-lineNum" href="#155"> 155: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="156" class="source-line"><td><a class="source-lineNum" href="#156"> 156: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="157" class="source-line"><td><a class="source-lineNum" href="#157"> 157: </a></td><td>	<span class="php-kw">protected</span> <span class="php-kw">function</span> getList(): string {</td></tr><tr id="158" class="source-line"><td><a class="source-lineNum" href="#158"> 158: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="159" class="source-line"><td><a class="source-lineNum" href="#159"> 159: </a></td><td>			<span class="php-var">$filter_name</span> = <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>];</td></tr><tr id="160" class="source-line"><td><a class="source-lineNum" href="#160"> 160: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="161" class="source-line"><td><a class="source-lineNum" href="#161"> 161: </a></td><td>			<span class="php-var">$filter_name</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="162" class="source-line"><td><a class="source-lineNum" href="#162"> 162: </a></td><td>		}</td></tr><tr id="163" class="source-line"><td><a class="source-lineNum" href="#163"> 163: </a></td><td></td></tr><tr id="164" class="source-line"><td><a class="source-lineNum" href="#164"> 164: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="165" class="source-line"><td><a class="source-lineNum" href="#165"> 165: </a></td><td>			<span class="php-var">$filter_email</span> = <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>];</td></tr><tr id="166" class="source-line"><td><a class="source-lineNum" href="#166"> 166: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="167" class="source-line"><td><a class="source-lineNum" href="#167"> 167: </a></td><td>			<span class="php-var">$filter_email</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="168" class="source-line"><td><a class="source-lineNum" href="#168"> 168: </a></td><td>		}</td></tr><tr id="169" class="source-line"><td><a class="source-lineNum" href="#169"> 169: </a></td><td></td></tr><tr id="170" class="source-line"><td><a class="source-lineNum" href="#170"> 170: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="171" class="source-line"><td><a class="source-lineNum" href="#171"> 171: </a></td><td>			<span class="php-var">$filter_customer_group_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="172" class="source-line"><td><a class="source-lineNum" href="#172"> 172: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="173" class="source-line"><td><a class="source-lineNum" href="#173"> 173: </a></td><td>			<span class="php-var">$filter_customer_group_id</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="174" class="source-line"><td><a class="source-lineNum" href="#174"> 174: </a></td><td>		}</td></tr><tr id="175" class="source-line"><td><a class="source-lineNum" href="#175"> 175: </a></td><td></td></tr><tr id="176" class="source-line"><td><a class="source-lineNum" href="#176"> 176: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="177" class="source-line"><td><a class="source-lineNum" href="#177"> 177: </a></td><td>			<span class="php-var">$filter_status</span> = (bool)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="178" class="source-line"><td><a class="source-lineNum" href="#178"> 178: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="179" class="source-line"><td><a class="source-lineNum" href="#179"> 179: </a></td><td>			<span class="php-var">$filter_status</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="180" class="source-line"><td><a class="source-lineNum" href="#180"> 180: </a></td><td>		}</td></tr><tr id="181" class="source-line"><td><a class="source-lineNum" href="#181"> 181: </a></td><td></td></tr><tr id="182" class="source-line"><td><a class="source-lineNum" href="#182"> 182: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="183" class="source-line"><td><a class="source-lineNum" href="#183"> 183: </a></td><td>			<span class="php-var">$filter_ip</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="184" class="source-line"><td><a class="source-lineNum" href="#184"> 184: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="185" class="source-line"><td><a class="source-lineNum" href="#185"> 185: </a></td><td>			<span class="php-var">$filter_ip</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="186" class="source-line"><td><a class="source-lineNum" href="#186"> 186: </a></td><td>		}</td></tr><tr id="187" class="source-line"><td><a class="source-lineNum" href="#187"> 187: </a></td><td></td></tr><tr id="188" class="source-line"><td><a class="source-lineNum" href="#188"> 188: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="189" class="source-line"><td><a class="source-lineNum" href="#189"> 189: </a></td><td>			<span class="php-var">$filter_date_from</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="190" class="source-line"><td><a class="source-lineNum" href="#190"> 190: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="191" class="source-line"><td><a class="source-lineNum" href="#191"> 191: </a></td><td>			<span class="php-var">$filter_date_from</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="192" class="source-line"><td><a class="source-lineNum" href="#192"> 192: </a></td><td>		}</td></tr><tr id="193" class="source-line"><td><a class="source-lineNum" href="#193"> 193: </a></td><td></td></tr><tr id="194" class="source-line"><td><a class="source-lineNum" href="#194"> 194: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="195" class="source-line"><td><a class="source-lineNum" href="#195"> 195: </a></td><td>			<span class="php-var">$filter_date_to</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="196" class="source-line"><td><a class="source-lineNum" href="#196"> 196: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="197" class="source-line"><td><a class="source-lineNum" href="#197"> 197: </a></td><td>			<span class="php-var">$filter_date_to</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="198" class="source-line"><td><a class="source-lineNum" href="#198"> 198: </a></td><td>		}</td></tr><tr id="199" class="source-line"><td><a class="source-lineNum" href="#199"> 199: </a></td><td></td></tr><tr id="200" class="source-line"><td><a class="source-lineNum" href="#200"> 200: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>])) {</td></tr><tr id="201" class="source-line"><td><a class="source-lineNum" href="#201"> 201: </a></td><td>			<span class="php-var">$sort</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>];</td></tr><tr id="202" class="source-line"><td><a class="source-lineNum" href="#202"> 202: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="203" class="source-line"><td><a class="source-lineNum" href="#203"> 203: </a></td><td>			<span class="php-var">$sort</span> = <span class="php-str">&#039;name&#039;</span>;</td></tr><tr id="204" class="source-line"><td><a class="source-lineNum" href="#204"> 204: </a></td><td>		}</td></tr><tr id="205" class="source-line"><td><a class="source-lineNum" href="#205"> 205: </a></td><td></td></tr><tr id="206" class="source-line"><td><a class="source-lineNum" href="#206"> 206: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>])) {</td></tr><tr id="207" class="source-line"><td><a class="source-lineNum" href="#207"> 207: </a></td><td>			<span class="php-var">$order</span> = (string)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>];</td></tr><tr id="208" class="source-line"><td><a class="source-lineNum" href="#208"> 208: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="209" class="source-line"><td><a class="source-lineNum" href="#209"> 209: </a></td><td>			<span class="php-var">$order</span> = <span class="php-str">&#039;ASC&#039;</span>;</td></tr><tr id="210" class="source-line"><td><a class="source-lineNum" href="#210"> 210: </a></td><td>		}</td></tr><tr id="211" class="source-line"><td><a class="source-lineNum" href="#211"> 211: </a></td><td></td></tr><tr id="212" class="source-line"><td><a class="source-lineNum" href="#212"> 212: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>])) {</td></tr><tr id="213" class="source-line"><td><a class="source-lineNum" href="#213"> 213: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="214" class="source-line"><td><a class="source-lineNum" href="#214"> 214: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="215" class="source-line"><td><a class="source-lineNum" href="#215"> 215: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="216" class="source-line"><td><a class="source-lineNum" href="#216"> 216: </a></td><td>		}</td></tr><tr id="217" class="source-line"><td><a class="source-lineNum" href="#217"> 217: </a></td><td></td></tr><tr id="218" class="source-line"><td><a class="source-lineNum" href="#218"> 218: </a></td><td>		<span class="php-var">$url</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="219" class="source-line"><td><a class="source-lineNum" href="#219"> 219: </a></td><td></td></tr><tr id="220" class="source-line"><td><a class="source-lineNum" href="#220"> 220: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="221" class="source-line"><td><a class="source-lineNum" href="#221"> 221: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_name=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="222" class="source-line"><td><a class="source-lineNum" href="#222"> 222: </a></td><td>		}</td></tr><tr id="223" class="source-line"><td><a class="source-lineNum" href="#223"> 223: </a></td><td></td></tr><tr id="224" class="source-line"><td><a class="source-lineNum" href="#224"> 224: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="225" class="source-line"><td><a class="source-lineNum" href="#225"> 225: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_email=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="226" class="source-line"><td><a class="source-lineNum" href="#226"> 226: </a></td><td>		}</td></tr><tr id="227" class="source-line"><td><a class="source-lineNum" href="#227"> 227: </a></td><td></td></tr><tr id="228" class="source-line"><td><a class="source-lineNum" href="#228"> 228: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="229" class="source-line"><td><a class="source-lineNum" href="#229"> 229: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_customer_group_id=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="230" class="source-line"><td><a class="source-lineNum" href="#230"> 230: </a></td><td>		}</td></tr><tr id="231" class="source-line"><td><a class="source-lineNum" href="#231"> 231: </a></td><td></td></tr><tr id="232" class="source-line"><td><a class="source-lineNum" href="#232"> 232: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="233" class="source-line"><td><a class="source-lineNum" href="#233"> 233: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_status=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="234" class="source-line"><td><a class="source-lineNum" href="#234"> 234: </a></td><td>		}</td></tr><tr id="235" class="source-line"><td><a class="source-lineNum" href="#235"> 235: </a></td><td></td></tr><tr id="236" class="source-line"><td><a class="source-lineNum" href="#236"> 236: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="237" class="source-line"><td><a class="source-lineNum" href="#237"> 237: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_ip=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="238" class="source-line"><td><a class="source-lineNum" href="#238"> 238: </a></td><td>		}</td></tr><tr id="239" class="source-line"><td><a class="source-lineNum" href="#239"> 239: </a></td><td></td></tr><tr id="240" class="source-line"><td><a class="source-lineNum" href="#240"> 240: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="241" class="source-line"><td><a class="source-lineNum" href="#241"> 241: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_from=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="242" class="source-line"><td><a class="source-lineNum" href="#242"> 242: </a></td><td>		}</td></tr><tr id="243" class="source-line"><td><a class="source-lineNum" href="#243"> 243: </a></td><td></td></tr><tr id="244" class="source-line"><td><a class="source-lineNum" href="#244"> 244: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="245" class="source-line"><td><a class="source-lineNum" href="#245"> 245: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_to=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="246" class="source-line"><td><a class="source-lineNum" href="#246"> 246: </a></td><td>		}</td></tr><tr id="247" class="source-line"><td><a class="source-lineNum" href="#247"> 247: </a></td><td></td></tr><tr id="248" class="source-line"><td><a class="source-lineNum" href="#248"> 248: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>])) {</td></tr><tr id="249" class="source-line"><td><a class="source-lineNum" href="#249"> 249: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;sort=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>];</td></tr><tr id="250" class="source-line"><td><a class="source-lineNum" href="#250"> 250: </a></td><td>		}</td></tr><tr id="251" class="source-line"><td><a class="source-lineNum" href="#251"> 251: </a></td><td></td></tr><tr id="252" class="source-line"><td><a class="source-lineNum" href="#252"> 252: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>])) {</td></tr><tr id="253" class="source-line"><td><a class="source-lineNum" href="#253"> 253: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;order=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>];</td></tr><tr id="254" class="source-line"><td><a class="source-lineNum" href="#254"> 254: </a></td><td>		}</td></tr><tr id="255" class="source-line"><td><a class="source-lineNum" href="#255"> 255: </a></td><td></td></tr><tr id="256" class="source-line"><td><a class="source-lineNum" href="#256"> 256: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>])) {</td></tr><tr id="257" class="source-line"><td><a class="source-lineNum" href="#257"> 257: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;page=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="258" class="source-line"><td><a class="source-lineNum" href="#258"> 258: </a></td><td>		}</td></tr><tr id="259" class="source-line"><td><a class="source-lineNum" href="#259"> 259: </a></td><td></td></tr><tr id="260" class="source-line"><td><a class="source-lineNum" href="#260"> 260: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;action&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-var">$url</span>);</td></tr><tr id="261" class="source-line"><td><a class="source-lineNum" href="#261"> 261: </a></td><td></td></tr><tr id="262" class="source-line"><td><a class="source-lineNum" href="#262"> 262: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;setting/store&#039;</span>);</td></tr><tr id="263" class="source-line"><td><a class="source-lineNum" href="#263"> 263: </a></td><td></td></tr><tr id="264" class="source-line"><td><a class="source-lineNum" href="#264"> 264: </a></td><td>		<span class="php-var">$stores</span> = <span class="php-var">$this</span>-&gt;model_setting_store-&gt;getStores();</td></tr><tr id="265" class="source-line"><td><a class="source-lineNum" href="#265"> 265: </a></td><td></td></tr><tr id="266" class="source-line"><td><a class="source-lineNum" href="#266"> 266: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;customers&#039;</span>] = [];</td></tr><tr id="267" class="source-line"><td><a class="source-lineNum" href="#267"> 267: </a></td><td></td></tr><tr id="268" class="source-line"><td><a class="source-lineNum" href="#268"> 268: </a></td><td>		<span class="php-var">$filter_data</span> = [</td></tr><tr id="269" class="source-line"><td><a class="source-lineNum" href="#269"> 269: </a></td><td>			<span class="php-str">&#039;filter_name&#039;</span>              =&gt; <span class="php-var">$filter_name</span>,</td></tr><tr id="270" class="source-line"><td><a class="source-lineNum" href="#270"> 270: </a></td><td>			<span class="php-str">&#039;filter_email&#039;</span>             =&gt; <span class="php-var">$filter_email</span>,</td></tr><tr id="271" class="source-line"><td><a class="source-lineNum" href="#271"> 271: </a></td><td>			<span class="php-str">&#039;filter_customer_group_id&#039;</span> =&gt; <span class="php-var">$filter_customer_group_id</span>,</td></tr><tr id="272" class="source-line"><td><a class="source-lineNum" href="#272"> 272: </a></td><td>			<span class="php-str">&#039;filter_status&#039;</span>            =&gt; <span class="php-var">$filter_status</span>,</td></tr><tr id="273" class="source-line"><td><a class="source-lineNum" href="#273"> 273: </a></td><td>			<span class="php-str">&#039;filter_ip&#039;</span>                =&gt; <span class="php-var">$filter_ip</span>,</td></tr><tr id="274" class="source-line"><td><a class="source-lineNum" href="#274"> 274: </a></td><td>			<span class="php-str">&#039;filter_date_from&#039;</span>         =&gt; <span class="php-var">$filter_date_from</span>,</td></tr><tr id="275" class="source-line"><td><a class="source-lineNum" href="#275"> 275: </a></td><td>			<span class="php-str">&#039;filter_date_to&#039;</span>           =&gt; <span class="php-var">$filter_date_to</span>,</td></tr><tr id="276" class="source-line"><td><a class="source-lineNum" href="#276"> 276: </a></td><td>			<span class="php-str">&#039;sort&#039;</span>                     =&gt; <span class="php-var">$sort</span>,</td></tr><tr id="277" class="source-line"><td><a class="source-lineNum" href="#277"> 277: </a></td><td>			<span class="php-str">&#039;order&#039;</span>                    =&gt; <span class="php-var">$order</span>,</td></tr><tr id="278" class="source-line"><td><a class="source-lineNum" href="#278"> 278: </a></td><td>			<span class="php-str">&#039;start&#039;</span>                    =&gt; (<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>),</td></tr><tr id="279" class="source-line"><td><a class="source-lineNum" href="#279"> 279: </a></td><td>			<span class="php-str">&#039;limit&#039;</span>                    =&gt; <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>)</td></tr><tr id="280" class="source-line"><td><a class="source-lineNum" href="#280"> 280: </a></td><td>		];</td></tr><tr id="281" class="source-line"><td><a class="source-lineNum" href="#281"> 281: </a></td><td></td></tr><tr id="282" class="source-line"><td><a class="source-lineNum" href="#282"> 282: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="283" class="source-line"><td><a class="source-lineNum" href="#283"> 283: </a></td><td></td></tr><tr id="284" class="source-line"><td><a class="source-lineNum" href="#284"> 284: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomers(<span class="php-var">$filter_data</span>);</td></tr><tr id="285" class="source-line"><td><a class="source-lineNum" href="#285"> 285: </a></td><td></td></tr><tr id="286" class="source-line"><td><a class="source-lineNum" href="#286"> 286: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="287" class="source-line"><td><a class="source-lineNum" href="#287"> 287: </a></td><td>			<span class="php-var">$login_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalLoginAttempts(<span class="php-var">$result</span>[<span class="php-str">&#039;email&#039;</span>]);</td></tr><tr id="288" class="source-line"><td><a class="source-lineNum" href="#288"> 288: </a></td><td></td></tr><tr id="289" class="source-line"><td><a class="source-lineNum" href="#289"> 289: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$login_info</span> &amp;&amp; <span class="php-var">$login_info</span>[<span class="php-str">&#039;total&#039;</span>] &gt;= <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_login_attempts&#039;</span>)) {</td></tr><tr id="290" class="source-line"><td><a class="source-lineNum" href="#290"> 290: </a></td><td>				<span class="php-var">$unlock</span> = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.unlock&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;email=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;email&#039;</span>] . <span class="php-var">$url</span>);</td></tr><tr id="291" class="source-line"><td><a class="source-lineNum" href="#291"> 291: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="292" class="source-line"><td><a class="source-lineNum" href="#292"> 292: </a></td><td>				<span class="php-var">$unlock</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="293" class="source-line"><td><a class="source-lineNum" href="#293"> 293: </a></td><td>			}</td></tr><tr id="294" class="source-line"><td><a class="source-lineNum" href="#294"> 294: </a></td><td></td></tr><tr id="295" class="source-line"><td><a class="source-lineNum" href="#295"> 295: </a></td><td>			<span class="php-var">$store_data</span> = [];</td></tr><tr id="296" class="source-line"><td><a class="source-lineNum" href="#296"> 296: </a></td><td></td></tr><tr id="297" class="source-line"><td><a class="source-lineNum" href="#297"> 297: </a></td><td>			<span class="php-var">$store_data</span>[] = [</td></tr><tr id="298" class="source-line"><td><a class="source-lineNum" href="#298"> 298: </a></td><td>				<span class="php-str">&#039;store_id&#039;</span> =&gt; <span class="php-num">0</span>,</td></tr><tr id="299" class="source-line"><td><a class="source-lineNum" href="#299"> 299: </a></td><td>				<span class="php-str">&#039;name&#039;</span>     =&gt; <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_name&#039;</span>),</td></tr><tr id="300" class="source-line"><td><a class="source-lineNum" href="#300"> 300: </a></td><td>				<span class="php-str">&#039;href&#039;</span>     =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.login&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;customer_id&#039;</span>] . <span class="php-str">&#039;&amp;store_id=0&#039;</span>)</td></tr><tr id="301" class="source-line"><td><a class="source-lineNum" href="#301"> 301: </a></td><td>			];</td></tr><tr id="302" class="source-line"><td><a class="source-lineNum" href="#302"> 302: </a></td><td></td></tr><tr id="303" class="source-line"><td><a class="source-lineNum" href="#303"> 303: </a></td><td>			<span class="php-kw">foreach</span> (<span class="php-var">$stores</span> <span class="php-kw">as</span> <span class="php-var">$store</span>) {</td></tr><tr id="304" class="source-line"><td><a class="source-lineNum" href="#304"> 304: </a></td><td>				<span class="php-var">$store_data</span>[] = [</td></tr><tr id="305" class="source-line"><td><a class="source-lineNum" href="#305"> 305: </a></td><td>					<span class="php-str">&#039;store_id&#039;</span> =&gt; <span class="php-var">$store</span>[<span class="php-str">&#039;store_id&#039;</span>],</td></tr><tr id="306" class="source-line"><td><a class="source-lineNum" href="#306"> 306: </a></td><td>					<span class="php-str">&#039;name&#039;</span>     =&gt; <span class="php-var">$store</span>[<span class="php-str">&#039;name&#039;</span>],</td></tr><tr id="307" class="source-line"><td><a class="source-lineNum" href="#307"> 307: </a></td><td>					<span class="php-str">&#039;href&#039;</span>     =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.login&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;customer_id&#039;</span>] . <span class="php-str">&#039;&amp;store_id=&#039;</span> . <span class="php-var">$store</span>[<span class="php-str">&#039;store_id&#039;</span>])</td></tr><tr id="308" class="source-line"><td><a class="source-lineNum" href="#308"> 308: </a></td><td>				];</td></tr><tr id="309" class="source-line"><td><a class="source-lineNum" href="#309"> 309: </a></td><td>			}</td></tr><tr id="310" class="source-line"><td><a class="source-lineNum" href="#310"> 310: </a></td><td></td></tr><tr id="311" class="source-line"><td><a class="source-lineNum" href="#311"> 311: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;customers&#039;</span>][] = [</td></tr><tr id="312" class="source-line"><td><a class="source-lineNum" href="#312"> 312: </a></td><td>				<span class="php-str">&#039;customer_id&#039;</span>    =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;customer_id&#039;</span>],</td></tr><tr id="313" class="source-line"><td><a class="source-lineNum" href="#313"> 313: </a></td><td>				<span class="php-str">&#039;name&#039;</span>           =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;name&#039;</span>],</td></tr><tr id="314" class="source-line"><td><a class="source-lineNum" href="#314"> 314: </a></td><td>				<span class="php-str">&#039;email&#039;</span>          =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;email&#039;</span>],</td></tr><tr id="315" class="source-line"><td><a class="source-lineNum" href="#315"> 315: </a></td><td>				<span class="php-str">&#039;store_id&#039;</span>       =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;store_id&#039;</span>],</td></tr><tr id="316" class="source-line"><td><a class="source-lineNum" href="#316"> 316: </a></td><td>				<span class="php-str">&#039;customer_group&#039;</span> =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;customer_group&#039;</span>],</td></tr><tr id="317" class="source-line"><td><a class="source-lineNum" href="#317"> 317: </a></td><td>				<span class="php-str">&#039;status&#039;</span>         =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;status&#039;</span>],</td></tr><tr id="318" class="source-line"><td><a class="source-lineNum" href="#318"> 318: </a></td><td>				<span class="php-str">&#039;date_added&#039;</span>     =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;date_format_short&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_added&#039;</span>])),</td></tr><tr id="319" class="source-line"><td><a class="source-lineNum" href="#319"> 319: </a></td><td>				<span class="php-str">&#039;unlock&#039;</span>         =&gt; <span class="php-var">$unlock</span>,</td></tr><tr id="320" class="source-line"><td><a class="source-lineNum" href="#320"> 320: </a></td><td>				<span class="php-str">&#039;store&#039;</span>          =&gt; <span class="php-var">$store_data</span>,</td></tr><tr id="321" class="source-line"><td><a class="source-lineNum" href="#321"> 321: </a></td><td>				<span class="php-str">&#039;edit&#039;</span>           =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.form&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;customer_id&#039;</span>] . <span class="php-var">$url</span>)</td></tr><tr id="322" class="source-line"><td><a class="source-lineNum" href="#322"> 322: </a></td><td>			];</td></tr><tr id="323" class="source-line"><td><a class="source-lineNum" href="#323"> 323: </a></td><td>		}</td></tr><tr id="324" class="source-line"><td><a class="source-lineNum" href="#324"> 324: </a></td><td></td></tr><tr id="325" class="source-line"><td><a class="source-lineNum" href="#325"> 325: </a></td><td>		<span class="php-var">$url</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="326" class="source-line"><td><a class="source-lineNum" href="#326"> 326: </a></td><td></td></tr><tr id="327" class="source-line"><td><a class="source-lineNum" href="#327"> 327: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="328" class="source-line"><td><a class="source-lineNum" href="#328"> 328: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_name=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="329" class="source-line"><td><a class="source-lineNum" href="#329"> 329: </a></td><td>		}</td></tr><tr id="330" class="source-line"><td><a class="source-lineNum" href="#330"> 330: </a></td><td></td></tr><tr id="331" class="source-line"><td><a class="source-lineNum" href="#331"> 331: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="332" class="source-line"><td><a class="source-lineNum" href="#332"> 332: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_email=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="333" class="source-line"><td><a class="source-lineNum" href="#333"> 333: </a></td><td>		}</td></tr><tr id="334" class="source-line"><td><a class="source-lineNum" href="#334"> 334: </a></td><td></td></tr><tr id="335" class="source-line"><td><a class="source-lineNum" href="#335"> 335: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="336" class="source-line"><td><a class="source-lineNum" href="#336"> 336: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_customer_group_id=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="337" class="source-line"><td><a class="source-lineNum" href="#337"> 337: </a></td><td>		}</td></tr><tr id="338" class="source-line"><td><a class="source-lineNum" href="#338"> 338: </a></td><td></td></tr><tr id="339" class="source-line"><td><a class="source-lineNum" href="#339"> 339: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="340" class="source-line"><td><a class="source-lineNum" href="#340"> 340: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_status=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="341" class="source-line"><td><a class="source-lineNum" href="#341"> 341: </a></td><td>		}</td></tr><tr id="342" class="source-line"><td><a class="source-lineNum" href="#342"> 342: </a></td><td></td></tr><tr id="343" class="source-line"><td><a class="source-lineNum" href="#343"> 343: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="344" class="source-line"><td><a class="source-lineNum" href="#344"> 344: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_ip=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="345" class="source-line"><td><a class="source-lineNum" href="#345"> 345: </a></td><td>		}</td></tr><tr id="346" class="source-line"><td><a class="source-lineNum" href="#346"> 346: </a></td><td></td></tr><tr id="347" class="source-line"><td><a class="source-lineNum" href="#347"> 347: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="348" class="source-line"><td><a class="source-lineNum" href="#348"> 348: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_from=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="349" class="source-line"><td><a class="source-lineNum" href="#349"> 349: </a></td><td>		}</td></tr><tr id="350" class="source-line"><td><a class="source-lineNum" href="#350"> 350: </a></td><td></td></tr><tr id="351" class="source-line"><td><a class="source-lineNum" href="#351"> 351: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="352" class="source-line"><td><a class="source-lineNum" href="#352"> 352: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_to=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="353" class="source-line"><td><a class="source-lineNum" href="#353"> 353: </a></td><td>		}</td></tr><tr id="354" class="source-line"><td><a class="source-lineNum" href="#354"> 354: </a></td><td></td></tr><tr id="355" class="source-line"><td><a class="source-lineNum" href="#355"> 355: </a></td><td>		<span class="php-kw">if</span> (<span class="php-var">$order</span> == <span class="php-str">&#039;ASC&#039;</span>) {</td></tr><tr id="356" class="source-line"><td><a class="source-lineNum" href="#356"> 356: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;order=DESC&#039;</span>;</td></tr><tr id="357" class="source-line"><td><a class="source-lineNum" href="#357"> 357: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="358" class="source-line"><td><a class="source-lineNum" href="#358"> 358: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;order=ASC&#039;</span>;</td></tr><tr id="359" class="source-line"><td><a class="source-lineNum" href="#359"> 359: </a></td><td>		}</td></tr><tr id="360" class="source-line"><td><a class="source-lineNum" href="#360"> 360: </a></td><td></td></tr><tr id="361" class="source-line"><td><a class="source-lineNum" href="#361"> 361: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;sort_name&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;sort=name&#039;</span> . <span class="php-var">$url</span>);</td></tr><tr id="362" class="source-line"><td><a class="source-lineNum" href="#362"> 362: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;sort_email&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;sort=c.email&#039;</span> . <span class="php-var">$url</span>);</td></tr><tr id="363" class="source-line"><td><a class="source-lineNum" href="#363"> 363: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;sort_customer_group&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;sort=customer_group&#039;</span> . <span class="php-var">$url</span>);</td></tr><tr id="364" class="source-line"><td><a class="source-lineNum" href="#364"> 364: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;sort_status&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;sort=c.status&#039;</span> . <span class="php-var">$url</span>);</td></tr><tr id="365" class="source-line"><td><a class="source-lineNum" href="#365"> 365: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;sort_date_added&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;sort=c.date_added&#039;</span> . <span class="php-var">$url</span>);</td></tr><tr id="366" class="source-line"><td><a class="source-lineNum" href="#366"> 366: </a></td><td></td></tr><tr id="367" class="source-line"><td><a class="source-lineNum" href="#367"> 367: </a></td><td>		<span class="php-var">$url</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="368" class="source-line"><td><a class="source-lineNum" href="#368"> 368: </a></td><td></td></tr><tr id="369" class="source-line"><td><a class="source-lineNum" href="#369"> 369: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="370" class="source-line"><td><a class="source-lineNum" href="#370"> 370: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_name=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="371" class="source-line"><td><a class="source-lineNum" href="#371"> 371: </a></td><td>		}</td></tr><tr id="372" class="source-line"><td><a class="source-lineNum" href="#372"> 372: </a></td><td></td></tr><tr id="373" class="source-line"><td><a class="source-lineNum" href="#373"> 373: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="374" class="source-line"><td><a class="source-lineNum" href="#374"> 374: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_email=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="375" class="source-line"><td><a class="source-lineNum" href="#375"> 375: </a></td><td>		}</td></tr><tr id="376" class="source-line"><td><a class="source-lineNum" href="#376"> 376: </a></td><td></td></tr><tr id="377" class="source-line"><td><a class="source-lineNum" href="#377"> 377: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="378" class="source-line"><td><a class="source-lineNum" href="#378"> 378: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_customer_group_id=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="379" class="source-line"><td><a class="source-lineNum" href="#379"> 379: </a></td><td>		}</td></tr><tr id="380" class="source-line"><td><a class="source-lineNum" href="#380"> 380: </a></td><td></td></tr><tr id="381" class="source-line"><td><a class="source-lineNum" href="#381"> 381: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="382" class="source-line"><td><a class="source-lineNum" href="#382"> 382: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_status=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="383" class="source-line"><td><a class="source-lineNum" href="#383"> 383: </a></td><td>		}</td></tr><tr id="384" class="source-line"><td><a class="source-lineNum" href="#384"> 384: </a></td><td></td></tr><tr id="385" class="source-line"><td><a class="source-lineNum" href="#385"> 385: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="386" class="source-line"><td><a class="source-lineNum" href="#386"> 386: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_ip=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="387" class="source-line"><td><a class="source-lineNum" href="#387"> 387: </a></td><td>		}</td></tr><tr id="388" class="source-line"><td><a class="source-lineNum" href="#388"> 388: </a></td><td></td></tr><tr id="389" class="source-line"><td><a class="source-lineNum" href="#389"> 389: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="390" class="source-line"><td><a class="source-lineNum" href="#390"> 390: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_from=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="391" class="source-line"><td><a class="source-lineNum" href="#391"> 391: </a></td><td>		}</td></tr><tr id="392" class="source-line"><td><a class="source-lineNum" href="#392"> 392: </a></td><td></td></tr><tr id="393" class="source-line"><td><a class="source-lineNum" href="#393"> 393: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="394" class="source-line"><td><a class="source-lineNum" href="#394"> 394: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_to=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="395" class="source-line"><td><a class="source-lineNum" href="#395"> 395: </a></td><td>		}</td></tr><tr id="396" class="source-line"><td><a class="source-lineNum" href="#396"> 396: </a></td><td></td></tr><tr id="397" class="source-line"><td><a class="source-lineNum" href="#397"> 397: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>])) {</td></tr><tr id="398" class="source-line"><td><a class="source-lineNum" href="#398"> 398: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;sort=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>];</td></tr><tr id="399" class="source-line"><td><a class="source-lineNum" href="#399"> 399: </a></td><td>		}</td></tr><tr id="400" class="source-line"><td><a class="source-lineNum" href="#400"> 400: </a></td><td></td></tr><tr id="401" class="source-line"><td><a class="source-lineNum" href="#401"> 401: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>])) {</td></tr><tr id="402" class="source-line"><td><a class="source-lineNum" href="#402"> 402: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;order=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>];</td></tr><tr id="403" class="source-line"><td><a class="source-lineNum" href="#403"> 403: </a></td><td>		}</td></tr><tr id="404" class="source-line"><td><a class="source-lineNum" href="#404"> 404: </a></td><td></td></tr><tr id="405" class="source-line"><td><a class="source-lineNum" href="#405"> 405: </a></td><td>		<span class="php-var">$customer_total</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalCustomers(<span class="php-var">$filter_data</span>);</td></tr><tr id="406" class="source-line"><td><a class="source-lineNum" href="#406"> 406: </a></td><td></td></tr><tr id="407" class="source-line"><td><a class="source-lineNum" href="#407"> 407: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="408" class="source-line"><td><a class="source-lineNum" href="#408"> 408: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$customer_total</span>,</td></tr><tr id="409" class="source-line"><td><a class="source-lineNum" href="#409"> 409: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="410" class="source-line"><td><a class="source-lineNum" href="#410"> 410: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>),</td></tr><tr id="411" class="source-line"><td><a class="source-lineNum" href="#411"> 411: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.list&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-var">$url</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="412" class="source-line"><td><a class="source-lineNum" href="#412"> 412: </a></td><td>		]);</td></tr><tr id="413" class="source-line"><td><a class="source-lineNum" href="#413"> 413: </a></td><td></td></tr><tr id="414" class="source-line"><td><a class="source-lineNum" href="#414"> 414: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$customer_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>)) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>)) &gt; (<span class="php-var">$customer_total</span> - <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>))) ? <span class="php-var">$customer_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>)) + <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>)), <span class="php-var">$customer_total</span>, ceil(<span class="php-var">$customer_total</span> / <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_pagination_admin&#039;</span>)));</td></tr><tr id="415" class="source-line"><td><a class="source-lineNum" href="#415"> 415: </a></td><td></td></tr><tr id="416" class="source-line"><td><a class="source-lineNum" href="#416"> 416: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;sort&#039;</span>] = <span class="php-var">$sort</span>;</td></tr><tr id="417" class="source-line"><td><a class="source-lineNum" href="#417"> 417: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;order&#039;</span>] = <span class="php-var">$order</span>;</td></tr><tr id="418" class="source-line"><td><a class="source-lineNum" href="#418"> 418: </a></td><td></td></tr><tr id="419" class="source-line"><td><a class="source-lineNum" href="#419"> 419: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_list&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="420" class="source-line"><td><a class="source-lineNum" href="#420"> 420: </a></td><td>	}</td></tr><tr id="421" class="source-line"><td><a class="source-lineNum" href="#421"> 421: </a></td><td></td></tr><tr id="422" class="source-line"><td><a class="source-lineNum" href="#422"> 422: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="423" class="source-line"><td><a class="source-lineNum" href="#423"> 423: </a></td><td><span class="php-comment">	 * Form</span></td></tr><tr id="424" class="source-line"><td><a class="source-lineNum" href="#424"> 424: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="425" class="source-line"><td><a class="source-lineNum" href="#425"> 425: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="426" class="source-line"><td><a class="source-lineNum" href="#426"> 426: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="427" class="source-line"><td><a class="source-lineNum" href="#427"> 427: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> form(): void {</td></tr><tr id="428" class="source-line"><td><a class="source-lineNum" href="#428"> 428: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="429" class="source-line"><td><a class="source-lineNum" href="#429"> 429: </a></td><td></td></tr><tr id="430" class="source-line"><td><a class="source-lineNum" href="#430"> 430: </a></td><td>		<span class="php-var">$this</span>-&gt;document-&gt;setTitle(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;heading_title&#039;</span>));</td></tr><tr id="431" class="source-line"><td><a class="source-lineNum" href="#431"> 431: </a></td><td></td></tr><tr id="432" class="source-line"><td><a class="source-lineNum" href="#432"> 432: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;text_form&#039;</span>] = !<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>]) ? <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_add&#039;</span>) : <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_edit&#039;</span>);</td></tr><tr id="433" class="source-line"><td><a class="source-lineNum" href="#433"> 433: </a></td><td></td></tr><tr id="434" class="source-line"><td><a class="source-lineNum" href="#434"> 434: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;error_upload_size&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_upload_size&#039;</span>), <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_file_max_size&#039;</span>));</td></tr><tr id="435" class="source-line"><td><a class="source-lineNum" href="#435"> 435: </a></td><td></td></tr><tr id="436" class="source-line"><td><a class="source-lineNum" href="#436"> 436: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;config_file_max_size&#039;</span>] = ((int)<span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_file_max_size&#039;</span>) * <span class="php-num">1024</span> * <span class="php-num">1024</span>);</td></tr><tr id="437" class="source-line"><td><a class="source-lineNum" href="#437"> 437: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;config_telephone_required&#039;</span>] = <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_telephone_required&#039;</span>);</td></tr><tr id="438" class="source-line"><td><a class="source-lineNum" href="#438"> 438: </a></td><td></td></tr><tr id="439" class="source-line"><td><a class="source-lineNum" href="#439"> 439: </a></td><td>		<span class="php-var">$url</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="440" class="source-line"><td><a class="source-lineNum" href="#440"> 440: </a></td><td></td></tr><tr id="441" class="source-line"><td><a class="source-lineNum" href="#441"> 441: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="442" class="source-line"><td><a class="source-lineNum" href="#442"> 442: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_name=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="443" class="source-line"><td><a class="source-lineNum" href="#443"> 443: </a></td><td>		}</td></tr><tr id="444" class="source-line"><td><a class="source-lineNum" href="#444"> 444: </a></td><td></td></tr><tr id="445" class="source-line"><td><a class="source-lineNum" href="#445"> 445: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="446" class="source-line"><td><a class="source-lineNum" href="#446"> 446: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_email=&#039;</span> . urlencode(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>));</td></tr><tr id="447" class="source-line"><td><a class="source-lineNum" href="#447"> 447: </a></td><td>		}</td></tr><tr id="448" class="source-line"><td><a class="source-lineNum" href="#448"> 448: </a></td><td></td></tr><tr id="449" class="source-line"><td><a class="source-lineNum" href="#449"> 449: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>])) {</td></tr><tr id="450" class="source-line"><td><a class="source-lineNum" href="#450"> 450: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_customer_group_id=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_customer_group_id&#039;</span>];</td></tr><tr id="451" class="source-line"><td><a class="source-lineNum" href="#451"> 451: </a></td><td>		}</td></tr><tr id="452" class="source-line"><td><a class="source-lineNum" href="#452"> 452: </a></td><td></td></tr><tr id="453" class="source-line"><td><a class="source-lineNum" href="#453"> 453: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>])) {</td></tr><tr id="454" class="source-line"><td><a class="source-lineNum" href="#454"> 454: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_status=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_status&#039;</span>];</td></tr><tr id="455" class="source-line"><td><a class="source-lineNum" href="#455"> 455: </a></td><td>		}</td></tr><tr id="456" class="source-line"><td><a class="source-lineNum" href="#456"> 456: </a></td><td></td></tr><tr id="457" class="source-line"><td><a class="source-lineNum" href="#457"> 457: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>])) {</td></tr><tr id="458" class="source-line"><td><a class="source-lineNum" href="#458"> 458: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_ip=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_ip&#039;</span>];</td></tr><tr id="459" class="source-line"><td><a class="source-lineNum" href="#459"> 459: </a></td><td>		}</td></tr><tr id="460" class="source-line"><td><a class="source-lineNum" href="#460"> 460: </a></td><td></td></tr><tr id="461" class="source-line"><td><a class="source-lineNum" href="#461"> 461: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>])) {</td></tr><tr id="462" class="source-line"><td><a class="source-lineNum" href="#462"> 462: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_from=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_from&#039;</span>];</td></tr><tr id="463" class="source-line"><td><a class="source-lineNum" href="#463"> 463: </a></td><td>		}</td></tr><tr id="464" class="source-line"><td><a class="source-lineNum" href="#464"> 464: </a></td><td></td></tr><tr id="465" class="source-line"><td><a class="source-lineNum" href="#465"> 465: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>])) {</td></tr><tr id="466" class="source-line"><td><a class="source-lineNum" href="#466"> 466: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;filter_date_to=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_date_to&#039;</span>];</td></tr><tr id="467" class="source-line"><td><a class="source-lineNum" href="#467"> 467: </a></td><td>		}</td></tr><tr id="468" class="source-line"><td><a class="source-lineNum" href="#468"> 468: </a></td><td></td></tr><tr id="469" class="source-line"><td><a class="source-lineNum" href="#469"> 469: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>])) {</td></tr><tr id="470" class="source-line"><td><a class="source-lineNum" href="#470"> 470: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;sort=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;sort&#039;</span>];</td></tr><tr id="471" class="source-line"><td><a class="source-lineNum" href="#471"> 471: </a></td><td>		}</td></tr><tr id="472" class="source-line"><td><a class="source-lineNum" href="#472"> 472: </a></td><td></td></tr><tr id="473" class="source-line"><td><a class="source-lineNum" href="#473"> 473: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>])) {</td></tr><tr id="474" class="source-line"><td><a class="source-lineNum" href="#474"> 474: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;order=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;order&#039;</span>];</td></tr><tr id="475" class="source-line"><td><a class="source-lineNum" href="#475"> 475: </a></td><td>		}</td></tr><tr id="476" class="source-line"><td><a class="source-lineNum" href="#476"> 476: </a></td><td></td></tr><tr id="477" class="source-line"><td><a class="source-lineNum" href="#477"> 477: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>])) {</td></tr><tr id="478" class="source-line"><td><a class="source-lineNum" href="#478"> 478: </a></td><td>			<span class="php-var">$url</span> .= <span class="php-str">&#039;&amp;page=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="479" class="source-line"><td><a class="source-lineNum" href="#479"> 479: </a></td><td>		}</td></tr><tr id="480" class="source-line"><td><a class="source-lineNum" href="#480"> 480: </a></td><td></td></tr><tr id="481" class="source-line"><td><a class="source-lineNum" href="#481"> 481: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;breadcrumbs&#039;</span>] = [];</td></tr><tr id="482" class="source-line"><td><a class="source-lineNum" href="#482"> 482: </a></td><td></td></tr><tr id="483" class="source-line"><td><a class="source-lineNum" href="#483"> 483: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;breadcrumbs&#039;</span>][] = [</td></tr><tr id="484" class="source-line"><td><a class="source-lineNum" href="#484"> 484: </a></td><td>			<span class="php-str">&#039;text&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_home&#039;</span>),</td></tr><tr id="485" class="source-line"><td><a class="source-lineNum" href="#485"> 485: </a></td><td>			<span class="php-str">&#039;href&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;common/dashboard&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>])</td></tr><tr id="486" class="source-line"><td><a class="source-lineNum" href="#486"> 486: </a></td><td>		];</td></tr><tr id="487" class="source-line"><td><a class="source-lineNum" href="#487"> 487: </a></td><td></td></tr><tr id="488" class="source-line"><td><a class="source-lineNum" href="#488"> 488: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;breadcrumbs&#039;</span>][] = [</td></tr><tr id="489" class="source-line"><td><a class="source-lineNum" href="#489"> 489: </a></td><td>			<span class="php-str">&#039;text&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;heading_title&#039;</span>),</td></tr><tr id="490" class="source-line"><td><a class="source-lineNum" href="#490"> 490: </a></td><td>			<span class="php-str">&#039;href&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-var">$url</span>)</td></tr><tr id="491" class="source-line"><td><a class="source-lineNum" href="#491"> 491: </a></td><td>		];</td></tr><tr id="492" class="source-line"><td><a class="source-lineNum" href="#492"> 492: </a></td><td></td></tr><tr id="493" class="source-line"><td><a class="source-lineNum" href="#493"> 493: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;save&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.save&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>]);</td></tr><tr id="494" class="source-line"><td><a class="source-lineNum" href="#494"> 494: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;back&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-var">$url</span>);</td></tr><tr id="495" class="source-line"><td><a class="source-lineNum" href="#495"> 495: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;upload&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;tool/upload.upload&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>]);</td></tr><tr id="496" class="source-line"><td><a class="source-lineNum" href="#496"> 496: </a></td><td></td></tr><tr id="497" class="source-line"><td><a class="source-lineNum" href="#497"> 497: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="498" class="source-line"><td><a class="source-lineNum" href="#498"> 498: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;orders&#039;</span>] = <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;sale/order&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;filter_customer_id=&#039;</span> . <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>]);</td></tr><tr id="499" class="source-line"><td><a class="source-lineNum" href="#499"> 499: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="500" class="source-line"><td><a class="source-lineNum" href="#500"> 500: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;orders&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="501" class="source-line"><td><a class="source-lineNum" href="#501"> 501: </a></td><td>		}</td></tr><tr id="502" class="source-line"><td><a class="source-lineNum" href="#502"> 502: </a></td><td></td></tr><tr id="503" class="source-line"><td><a class="source-lineNum" href="#503"> 503: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="504" class="source-line"><td><a class="source-lineNum" href="#504"> 504: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="505" class="source-line"><td><a class="source-lineNum" href="#505"> 505: </a></td><td></td></tr><tr id="506" class="source-line"><td><a class="source-lineNum" href="#506"> 506: </a></td><td>			<span class="php-var">$customer_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomer((int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>]);</td></tr><tr id="507" class="source-line"><td><a class="source-lineNum" href="#507"> 507: </a></td><td>		}</td></tr><tr id="508" class="source-line"><td><a class="source-lineNum" href="#508"> 508: </a></td><td></td></tr><tr id="509" class="source-line"><td><a class="source-lineNum" href="#509"> 509: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="510" class="source-line"><td><a class="source-lineNum" href="#510"> 510: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;customer_id&#039;</span>] = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="511" class="source-line"><td><a class="source-lineNum" href="#511"> 511: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="512" class="source-line"><td><a class="source-lineNum" href="#512"> 512: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;customer_id&#039;</span>] = <span class="php-num">0</span>;</td></tr><tr id="513" class="source-line"><td><a class="source-lineNum" href="#513"> 513: </a></td><td>		}</td></tr><tr id="514" class="source-line"><td><a class="source-lineNum" href="#514"> 514: </a></td><td></td></tr><tr id="515" class="source-line"><td><a class="source-lineNum" href="#515"> 515: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;stores&#039;</span>] = [];</td></tr><tr id="516" class="source-line"><td><a class="source-lineNum" href="#516"> 516: </a></td><td></td></tr><tr id="517" class="source-line"><td><a class="source-lineNum" href="#517"> 517: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;stores&#039;</span>][] = [</td></tr><tr id="518" class="source-line"><td><a class="source-lineNum" href="#518"> 518: </a></td><td>			<span class="php-str">&#039;store_id&#039;</span> =&gt; <span class="php-num">0</span>,</td></tr><tr id="519" class="source-line"><td><a class="source-lineNum" href="#519"> 519: </a></td><td>			<span class="php-str">&#039;name&#039;</span>     =&gt; <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_default&#039;</span>)</td></tr><tr id="520" class="source-line"><td><a class="source-lineNum" href="#520"> 520: </a></td><td>		];</td></tr><tr id="521" class="source-line"><td><a class="source-lineNum" href="#521"> 521: </a></td><td></td></tr><tr id="522" class="source-line"><td><a class="source-lineNum" href="#522"> 522: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;setting/store&#039;</span>);</td></tr><tr id="523" class="source-line"><td><a class="source-lineNum" href="#523"> 523: </a></td><td></td></tr><tr id="524" class="source-line"><td><a class="source-lineNum" href="#524"> 524: </a></td><td>		<span class="php-var">$stores</span> = <span class="php-var">$this</span>-&gt;model_setting_store-&gt;getStores();</td></tr><tr id="525" class="source-line"><td><a class="source-lineNum" href="#525"> 525: </a></td><td></td></tr><tr id="526" class="source-line"><td><a class="source-lineNum" href="#526"> 526: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$stores</span> <span class="php-kw">as</span> <span class="php-var">$store</span>) {</td></tr><tr id="527" class="source-line"><td><a class="source-lineNum" href="#527"> 527: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;stores&#039;</span>][] = [</td></tr><tr id="528" class="source-line"><td><a class="source-lineNum" href="#528"> 528: </a></td><td>				<span class="php-str">&#039;store_id&#039;</span> =&gt; <span class="php-var">$store</span>[<span class="php-str">&#039;store_id&#039;</span>],</td></tr><tr id="529" class="source-line"><td><a class="source-lineNum" href="#529"> 529: </a></td><td>				<span class="php-str">&#039;name&#039;</span>     =&gt; <span class="php-var">$store</span>[<span class="php-str">&#039;name&#039;</span>]</td></tr><tr id="530" class="source-line"><td><a class="source-lineNum" href="#530"> 530: </a></td><td>			];</td></tr><tr id="531" class="source-line"><td><a class="source-lineNum" href="#531"> 531: </a></td><td>		}</td></tr><tr id="532" class="source-line"><td><a class="source-lineNum" href="#532"> 532: </a></td><td></td></tr><tr id="533" class="source-line"><td><a class="source-lineNum" href="#533"> 533: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="534" class="source-line"><td><a class="source-lineNum" href="#534"> 534: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;store_id&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;store_id&#039;</span>];</td></tr><tr id="535" class="source-line"><td><a class="source-lineNum" href="#535"> 535: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="536" class="source-line"><td><a class="source-lineNum" href="#536"> 536: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;store_id&#039;</span>] = [<span class="php-num">0</span>];</td></tr><tr id="537" class="source-line"><td><a class="source-lineNum" href="#537"> 537: </a></td><td>		}</td></tr><tr id="538" class="source-line"><td><a class="source-lineNum" href="#538"> 538: </a></td><td></td></tr><tr id="539" class="source-line"><td><a class="source-lineNum" href="#539"> 539: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer_group&#039;</span>);</td></tr><tr id="540" class="source-line"><td><a class="source-lineNum" href="#540"> 540: </a></td><td></td></tr><tr id="541" class="source-line"><td><a class="source-lineNum" href="#541"> 541: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;customer_groups&#039;</span>] = <span class="php-var">$this</span>-&gt;model_customer_customer_group-&gt;getCustomerGroups();</td></tr><tr id="542" class="source-line"><td><a class="source-lineNum" href="#542"> 542: </a></td><td></td></tr><tr id="543" class="source-line"><td><a class="source-lineNum" href="#543"> 543: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="544" class="source-line"><td><a class="source-lineNum" href="#544"> 544: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;customer_group_id&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;customer_group_id&#039;</span>];</td></tr><tr id="545" class="source-line"><td><a class="source-lineNum" href="#545"> 545: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="546" class="source-line"><td><a class="source-lineNum" href="#546"> 546: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;customer_group_id&#039;</span>] = <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_customer_group_id&#039;</span>);</td></tr><tr id="547" class="source-line"><td><a class="source-lineNum" href="#547"> 547: </a></td><td>		}</td></tr><tr id="548" class="source-line"><td><a class="source-lineNum" href="#548"> 548: </a></td><td></td></tr><tr id="549" class="source-line"><td><a class="source-lineNum" href="#549"> 549: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="550" class="source-line"><td><a class="source-lineNum" href="#550"> 550: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;firstname&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;firstname&#039;</span>];</td></tr><tr id="551" class="source-line"><td><a class="source-lineNum" href="#551"> 551: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="552" class="source-line"><td><a class="source-lineNum" href="#552"> 552: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;firstname&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="553" class="source-line"><td><a class="source-lineNum" href="#553"> 553: </a></td><td>		}</td></tr><tr id="554" class="source-line"><td><a class="source-lineNum" href="#554"> 554: </a></td><td></td></tr><tr id="555" class="source-line"><td><a class="source-lineNum" href="#555"> 555: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="556" class="source-line"><td><a class="source-lineNum" href="#556"> 556: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;lastname&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;lastname&#039;</span>];</td></tr><tr id="557" class="source-line"><td><a class="source-lineNum" href="#557"> 557: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="558" class="source-line"><td><a class="source-lineNum" href="#558"> 558: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;lastname&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="559" class="source-line"><td><a class="source-lineNum" href="#559"> 559: </a></td><td>		}</td></tr><tr id="560" class="source-line"><td><a class="source-lineNum" href="#560"> 560: </a></td><td></td></tr><tr id="561" class="source-line"><td><a class="source-lineNum" href="#561"> 561: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="562" class="source-line"><td><a class="source-lineNum" href="#562"> 562: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;email&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;email&#039;</span>];</td></tr><tr id="563" class="source-line"><td><a class="source-lineNum" href="#563"> 563: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="564" class="source-line"><td><a class="source-lineNum" href="#564"> 564: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;email&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="565" class="source-line"><td><a class="source-lineNum" href="#565"> 565: </a></td><td>		}</td></tr><tr id="566" class="source-line"><td><a class="source-lineNum" href="#566"> 566: </a></td><td></td></tr><tr id="567" class="source-line"><td><a class="source-lineNum" href="#567"> 567: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="568" class="source-line"><td><a class="source-lineNum" href="#568"> 568: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;telephone&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;telephone&#039;</span>];</td></tr><tr id="569" class="source-line"><td><a class="source-lineNum" href="#569"> 569: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="570" class="source-line"><td><a class="source-lineNum" href="#570"> 570: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;telephone&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="571" class="source-line"><td><a class="source-lineNum" href="#571"> 571: </a></td><td>		}</td></tr><tr id="572" class="source-line"><td><a class="source-lineNum" href="#572"> 572: </a></td><td></td></tr><tr id="573" class="source-line"><td><a class="source-lineNum" href="#573"> 573: </a></td><td>		<span class="php-comment">// Custom Fields</span></td></tr><tr id="574" class="source-line"><td><a class="source-lineNum" href="#574"> 574: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;custom_fields&#039;</span>] = [];</td></tr><tr id="575" class="source-line"><td><a class="source-lineNum" href="#575"> 575: </a></td><td></td></tr><tr id="576" class="source-line"><td><a class="source-lineNum" href="#576"> 576: </a></td><td>		<span class="php-var">$filter_data</span> = [</td></tr><tr id="577" class="source-line"><td><a class="source-lineNum" href="#577"> 577: </a></td><td>			<span class="php-str">&#039;filter_location&#039;</span> =&gt; <span class="php-str">&#039;account&#039;</span>,</td></tr><tr id="578" class="source-line"><td><a class="source-lineNum" href="#578"> 578: </a></td><td>			<span class="php-str">&#039;sort&#039;</span>            =&gt; <span class="php-str">&#039;cf.sort_order&#039;</span>,</td></tr><tr id="579" class="source-line"><td><a class="source-lineNum" href="#579"> 579: </a></td><td>			<span class="php-str">&#039;order&#039;</span>           =&gt; <span class="php-str">&#039;ASC&#039;</span></td></tr><tr id="580" class="source-line"><td><a class="source-lineNum" href="#580"> 580: </a></td><td>		];</td></tr><tr id="581" class="source-line"><td><a class="source-lineNum" href="#581"> 581: </a></td><td></td></tr><tr id="582" class="source-line"><td><a class="source-lineNum" href="#582"> 582: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/custom_field&#039;</span>);</td></tr><tr id="583" class="source-line"><td><a class="source-lineNum" href="#583"> 583: </a></td><td></td></tr><tr id="584" class="source-line"><td><a class="source-lineNum" href="#584"> 584: </a></td><td>		<span class="php-var">$custom_fields</span> = <span class="php-var">$this</span>-&gt;model_customer_custom_field-&gt;getCustomFields(<span class="php-var">$filter_data</span>);</td></tr><tr id="585" class="source-line"><td><a class="source-lineNum" href="#585"> 585: </a></td><td></td></tr><tr id="586" class="source-line"><td><a class="source-lineNum" href="#586"> 586: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$custom_fields</span> <span class="php-kw">as</span> <span class="php-var">$custom_field</span>) {</td></tr><tr id="587" class="source-line"><td><a class="source-lineNum" href="#587"> 587: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$custom_field</span>[<span class="php-str">&#039;status&#039;</span>]) {</td></tr><tr id="588" class="source-line"><td><a class="source-lineNum" href="#588"> 588: </a></td><td>				<span class="php-var">$data</span>[<span class="php-str">&#039;custom_fields&#039;</span>][] = [</td></tr><tr id="589" class="source-line"><td><a class="source-lineNum" href="#589"> 589: </a></td><td>					<span class="php-str">&#039;custom_field_id&#039;</span>    =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>],</td></tr><tr id="590" class="source-line"><td><a class="source-lineNum" href="#590"> 590: </a></td><td>					<span class="php-str">&#039;custom_field_value&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;model_customer_custom_field-&gt;getValues(<span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>]),</td></tr><tr id="591" class="source-line"><td><a class="source-lineNum" href="#591"> 591: </a></td><td>					<span class="php-str">&#039;name&#039;</span>               =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;name&#039;</span>],</td></tr><tr id="592" class="source-line"><td><a class="source-lineNum" href="#592"> 592: </a></td><td>					<span class="php-str">&#039;value&#039;</span>              =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;value&#039;</span>],</td></tr><tr id="593" class="source-line"><td><a class="source-lineNum" href="#593"> 593: </a></td><td>					<span class="php-str">&#039;type&#039;</span>               =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;type&#039;</span>],</td></tr><tr id="594" class="source-line"><td><a class="source-lineNum" href="#594"> 594: </a></td><td>					<span class="php-str">&#039;location&#039;</span>           =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;location&#039;</span>],</td></tr><tr id="595" class="source-line"><td><a class="source-lineNum" href="#595"> 595: </a></td><td>					<span class="php-str">&#039;sort_order&#039;</span>         =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;sort_order&#039;</span>]</td></tr><tr id="596" class="source-line"><td><a class="source-lineNum" href="#596"> 596: </a></td><td>				];</td></tr><tr id="597" class="source-line"><td><a class="source-lineNum" href="#597"> 597: </a></td><td>			}</td></tr><tr id="598" class="source-line"><td><a class="source-lineNum" href="#598"> 598: </a></td><td>		}</td></tr><tr id="599" class="source-line"><td><a class="source-lineNum" href="#599"> 599: </a></td><td></td></tr><tr id="600" class="source-line"><td><a class="source-lineNum" href="#600"> 600: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="601" class="source-line"><td><a class="source-lineNum" href="#601"> 601: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;account_custom_field&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;custom_field&#039;</span>];</td></tr><tr id="602" class="source-line"><td><a class="source-lineNum" href="#602"> 602: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="603" class="source-line"><td><a class="source-lineNum" href="#603"> 603: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;account_custom_field&#039;</span>] = [];</td></tr><tr id="604" class="source-line"><td><a class="source-lineNum" href="#604"> 604: </a></td><td>		}</td></tr><tr id="605" class="source-line"><td><a class="source-lineNum" href="#605"> 605: </a></td><td></td></tr><tr id="606" class="source-line"><td><a class="source-lineNum" href="#606"> 606: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;password&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="607" class="source-line"><td><a class="source-lineNum" href="#607"> 607: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;confirm&#039;</span>] = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="608" class="source-line"><td><a class="source-lineNum" href="#608"> 608: </a></td><td></td></tr><tr id="609" class="source-line"><td><a class="source-lineNum" href="#609"> 609: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="610" class="source-line"><td><a class="source-lineNum" href="#610"> 610: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;newsletter&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;newsletter&#039;</span>];</td></tr><tr id="611" class="source-line"><td><a class="source-lineNum" href="#611"> 611: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="612" class="source-line"><td><a class="source-lineNum" href="#612"> 612: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;newsletter&#039;</span>] = <span class="php-num">0</span>;</td></tr><tr id="613" class="source-line"><td><a class="source-lineNum" href="#613"> 613: </a></td><td>		}</td></tr><tr id="614" class="source-line"><td><a class="source-lineNum" href="#614"> 614: </a></td><td></td></tr><tr id="615" class="source-line"><td><a class="source-lineNum" href="#615"> 615: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="616" class="source-line"><td><a class="source-lineNum" href="#616"> 616: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;status&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;status&#039;</span>];</td></tr><tr id="617" class="source-line"><td><a class="source-lineNum" href="#617"> 617: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="618" class="source-line"><td><a class="source-lineNum" href="#618"> 618: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;status&#039;</span>] = <span class="php-num">1</span>;</td></tr><tr id="619" class="source-line"><td><a class="source-lineNum" href="#619"> 619: </a></td><td>		}</td></tr><tr id="620" class="source-line"><td><a class="source-lineNum" href="#620"> 620: </a></td><td></td></tr><tr id="621" class="source-line"><td><a class="source-lineNum" href="#621"> 621: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="622" class="source-line"><td><a class="source-lineNum" href="#622"> 622: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;safe&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;safe&#039;</span>];</td></tr><tr id="623" class="source-line"><td><a class="source-lineNum" href="#623"> 623: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="624" class="source-line"><td><a class="source-lineNum" href="#624"> 624: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;safe&#039;</span>] = <span class="php-num">0</span>;</td></tr><tr id="625" class="source-line"><td><a class="source-lineNum" href="#625"> 625: </a></td><td>		}</td></tr><tr id="626" class="source-line"><td><a class="source-lineNum" href="#626"> 626: </a></td><td></td></tr><tr id="627" class="source-line"><td><a class="source-lineNum" href="#627"> 627: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-kw">empty</span>(<span class="php-var">$customer_info</span>)) {</td></tr><tr id="628" class="source-line"><td><a class="source-lineNum" href="#628"> 628: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;commenter&#039;</span>] = <span class="php-var">$customer_info</span>[<span class="php-str">&#039;commenter&#039;</span>];</td></tr><tr id="629" class="source-line"><td><a class="source-lineNum" href="#629"> 629: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="630" class="source-line"><td><a class="source-lineNum" href="#630"> 630: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;commenter&#039;</span>] = <span class="php-num">0</span>;</td></tr><tr id="631" class="source-line"><td><a class="source-lineNum" href="#631"> 631: </a></td><td>		}</td></tr><tr id="632" class="source-line"><td><a class="source-lineNum" href="#632"> 632: </a></td><td></td></tr><tr id="633" class="source-line"><td><a class="source-lineNum" href="#633"> 633: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;localisation/country&#039;</span>);</td></tr><tr id="634" class="source-line"><td><a class="source-lineNum" href="#634"> 634: </a></td><td></td></tr><tr id="635" class="source-line"><td><a class="source-lineNum" href="#635"> 635: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;countries&#039;</span>] = <span class="php-var">$this</span>-&gt;model_localisation_country-&gt;getCountries();</td></tr><tr id="636" class="source-line"><td><a class="source-lineNum" href="#636"> 636: </a></td><td></td></tr><tr id="637" class="source-line"><td><a class="source-lineNum" href="#637"> 637: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;address&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;customer/address.getAddress&#039;</span>);</td></tr><tr id="638" class="source-line"><td><a class="source-lineNum" href="#638"> 638: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;history&#039;</span>] = <span class="php-var">$this</span>-&gt;getHistory();</td></tr><tr id="639" class="source-line"><td><a class="source-lineNum" href="#639"> 639: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;transaction&#039;</span>] = <span class="php-var">$this</span>-&gt;getTransaction();</td></tr><tr id="640" class="source-line"><td><a class="source-lineNum" href="#640"> 640: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;reward&#039;</span>] = <span class="php-var">$this</span>-&gt;getReward();</td></tr><tr id="641" class="source-line"><td><a class="source-lineNum" href="#641"> 641: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;ip&#039;</span>] = <span class="php-var">$this</span>-&gt;getIp();</td></tr><tr id="642" class="source-line"><td><a class="source-lineNum" href="#642"> 642: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;authorize&#039;</span>] = <span class="php-var">$this</span>-&gt;getAuthorize();</td></tr><tr id="643" class="source-line"><td><a class="source-lineNum" href="#643"> 643: </a></td><td></td></tr><tr id="644" class="source-line"><td><a class="source-lineNum" href="#644"> 644: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;user_token&#039;</span>] = <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>];</td></tr><tr id="645" class="source-line"><td><a class="source-lineNum" href="#645"> 645: </a></td><td></td></tr><tr id="646" class="source-line"><td><a class="source-lineNum" href="#646"> 646: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;header&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/header&#039;</span>);</td></tr><tr id="647" class="source-line"><td><a class="source-lineNum" href="#647"> 647: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;column_left&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/column_left&#039;</span>);</td></tr><tr id="648" class="source-line"><td><a class="source-lineNum" href="#648"> 648: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;footer&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/footer&#039;</span>);</td></tr><tr id="649" class="source-line"><td><a class="source-lineNum" href="#649"> 649: </a></td><td></td></tr><tr id="650" class="source-line"><td><a class="source-lineNum" href="#650"> 650: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_form&#039;</span>, <span class="php-var">$data</span>));</td></tr><tr id="651" class="source-line"><td><a class="source-lineNum" href="#651"> 651: </a></td><td>	}</td></tr><tr id="652" class="source-line"><td><a class="source-lineNum" href="#652"> 652: </a></td><td></td></tr><tr id="653" class="source-line"><td><a class="source-lineNum" href="#653"> 653: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="654" class="source-line"><td><a class="source-lineNum" href="#654"> 654: </a></td><td><span class="php-comment">	 * Save</span></td></tr><tr id="655" class="source-line"><td><a class="source-lineNum" href="#655"> 655: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="656" class="source-line"><td><a class="source-lineNum" href="#656"> 656: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="657" class="source-line"><td><a class="source-lineNum" href="#657"> 657: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="658" class="source-line"><td><a class="source-lineNum" href="#658"> 658: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> save(): void {</td></tr><tr id="659" class="source-line"><td><a class="source-lineNum" href="#659"> 659: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="660" class="source-line"><td><a class="source-lineNum" href="#660"> 660: </a></td><td></td></tr><tr id="661" class="source-line"><td><a class="source-lineNum" href="#661"> 661: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="662" class="source-line"><td><a class="source-lineNum" href="#662"> 662: </a></td><td></td></tr><tr id="663" class="source-line"><td><a class="source-lineNum" href="#663"> 663: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="664" class="source-line"><td><a class="source-lineNum" href="#664"> 664: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;warning&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="665" class="source-line"><td><a class="source-lineNum" href="#665"> 665: </a></td><td>		}</td></tr><tr id="666" class="source-line"><td><a class="source-lineNum" href="#666"> 666: </a></td><td></td></tr><tr id="667" class="source-line"><td><a class="source-lineNum" href="#667"> 667: </a></td><td>		<span class="php-kw">if</span> (!oc_validate_length(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;firstname&#039;</span>], <span class="php-num">1</span>, <span class="php-num">32</span>)) {</td></tr><tr id="668" class="source-line"><td><a class="source-lineNum" href="#668"> 668: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;firstname&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_firstname&#039;</span>);</td></tr><tr id="669" class="source-line"><td><a class="source-lineNum" href="#669"> 669: </a></td><td>		}</td></tr><tr id="670" class="source-line"><td><a class="source-lineNum" href="#670"> 670: </a></td><td></td></tr><tr id="671" class="source-line"><td><a class="source-lineNum" href="#671"> 671: </a></td><td>		<span class="php-kw">if</span> (!oc_validate_length(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;lastname&#039;</span>], <span class="php-num">1</span>, <span class="php-num">32</span>)) {</td></tr><tr id="672" class="source-line"><td><a class="source-lineNum" href="#672"> 672: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;lastname&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_lastname&#039;</span>);</td></tr><tr id="673" class="source-line"><td><a class="source-lineNum" href="#673"> 673: </a></td><td>		}</td></tr><tr id="674" class="source-line"><td><a class="source-lineNum" href="#674"> 674: </a></td><td></td></tr><tr id="675" class="source-line"><td><a class="source-lineNum" href="#675"> 675: </a></td><td>		<span class="php-kw">if</span> ((oc_strlen(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;email&#039;</span>]) &gt; <span class="php-num">96</span>) || !filter_var(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;email&#039;</span>], FILTER_VALIDATE_EMAIL)) {</td></tr><tr id="676" class="source-line"><td><a class="source-lineNum" href="#676"> 676: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;email&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_email&#039;</span>);</td></tr><tr id="677" class="source-line"><td><a class="source-lineNum" href="#677"> 677: </a></td><td>		}</td></tr><tr id="678" class="source-line"><td><a class="source-lineNum" href="#678"> 678: </a></td><td></td></tr><tr id="679" class="source-line"><td><a class="source-lineNum" href="#679"> 679: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="680" class="source-line"><td><a class="source-lineNum" href="#680"> 680: </a></td><td></td></tr><tr id="681" class="source-line"><td><a class="source-lineNum" href="#681"> 681: </a></td><td>		<span class="php-var">$customer_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomerByEmail(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;email&#039;</span>]);</td></tr><tr id="682" class="source-line"><td><a class="source-lineNum" href="#682"> 682: </a></td><td></td></tr><tr id="683" class="source-line"><td><a class="source-lineNum" href="#683"> 683: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;customer_id&#039;</span>]) {</td></tr><tr id="684" class="source-line"><td><a class="source-lineNum" href="#684"> 684: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$customer_info</span>) {</td></tr><tr id="685" class="source-line"><td><a class="source-lineNum" href="#685"> 685: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;warning&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_exists&#039;</span>);</td></tr><tr id="686" class="source-line"><td><a class="source-lineNum" href="#686"> 686: </a></td><td>			}</td></tr><tr id="687" class="source-line"><td><a class="source-lineNum" href="#687"> 687: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="688" class="source-line"><td><a class="source-lineNum" href="#688"> 688: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$customer_info</span> &amp;&amp; (<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;customer_id&#039;</span>] != <span class="php-var">$customer_info</span>[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="689" class="source-line"><td><a class="source-lineNum" href="#689"> 689: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;warning&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_exists&#039;</span>);</td></tr><tr id="690" class="source-line"><td><a class="source-lineNum" href="#690"> 690: </a></td><td>			}</td></tr><tr id="691" class="source-line"><td><a class="source-lineNum" href="#691"> 691: </a></td><td>		}</td></tr><tr id="692" class="source-line"><td><a class="source-lineNum" href="#692"> 692: </a></td><td></td></tr><tr id="693" class="source-line"><td><a class="source-lineNum" href="#693"> 693: </a></td><td>		<span class="php-kw">if</span> (<span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_telephone_required&#039;</span>) &amp;&amp; (oc_strlen(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;telephone&#039;</span>]) &lt; <span class="php-num">3</span>) || (oc_strlen(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;telephone&#039;</span>]) &gt; <span class="php-num">32</span>)) {</td></tr><tr id="694" class="source-line"><td><a class="source-lineNum" href="#694"> 694: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;telephone&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_telephone&#039;</span>);</td></tr><tr id="695" class="source-line"><td><a class="source-lineNum" href="#695"> 695: </a></td><td>		}</td></tr><tr id="696" class="source-line"><td><a class="source-lineNum" href="#696"> 696: </a></td><td></td></tr><tr id="697" class="source-line"><td><a class="source-lineNum" href="#697"> 697: </a></td><td>		<span class="php-comment">// Custom field validation</span></td></tr><tr id="698" class="source-line"><td><a class="source-lineNum" href="#698"> 698: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/custom_field&#039;</span>);</td></tr><tr id="699" class="source-line"><td><a class="source-lineNum" href="#699"> 699: </a></td><td></td></tr><tr id="700" class="source-line"><td><a class="source-lineNum" href="#700"> 700: </a></td><td>		<span class="php-var">$filter_data</span> = [</td></tr><tr id="701" class="source-line"><td><a class="source-lineNum" href="#701"> 701: </a></td><td>			<span class="php-str">&#039;filter_location&#039;</span>          =&gt; <span class="php-str">&#039;account&#039;</span>,</td></tr><tr id="702" class="source-line"><td><a class="source-lineNum" href="#702"> 702: </a></td><td>			<span class="php-str">&#039;filter_customer_group_id&#039;</span> =&gt; <span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;customer_group_id&#039;</span>],</td></tr><tr id="703" class="source-line"><td><a class="source-lineNum" href="#703"> 703: </a></td><td>			<span class="php-str">&#039;filter_status&#039;</span>            =&gt; <span class="php-num">1</span></td></tr><tr id="704" class="source-line"><td><a class="source-lineNum" href="#704"> 704: </a></td><td>		];</td></tr><tr id="705" class="source-line"><td><a class="source-lineNum" href="#705"> 705: </a></td><td></td></tr><tr id="706" class="source-line"><td><a class="source-lineNum" href="#706"> 706: </a></td><td>		<span class="php-var">$custom_fields</span> = <span class="php-var">$this</span>-&gt;model_customer_custom_field-&gt;getCustomFields(<span class="php-var">$filter_data</span>);</td></tr><tr id="707" class="source-line"><td><a class="source-lineNum" href="#707"> 707: </a></td><td></td></tr><tr id="708" class="source-line"><td><a class="source-lineNum" href="#708"> 708: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$custom_fields</span> <span class="php-kw">as</span> <span class="php-var">$custom_field</span>) {</td></tr><tr id="709" class="source-line"><td><a class="source-lineNum" href="#709"> 709: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$custom_field</span>[<span class="php-str">&#039;required&#039;</span>] &amp;&amp; <span class="php-kw">empty</span>(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;custom_field&#039;</span>][<span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>]])) {</td></tr><tr id="710" class="source-line"><td><a class="source-lineNum" href="#710"> 710: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;custom_field_&#039;</span> . <span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>]] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_custom_field&#039;</span>), <span class="php-var">$custom_field</span>[<span class="php-str">&#039;name&#039;</span>]);</td></tr><tr id="711" class="source-line"><td><a class="source-lineNum" href="#711"> 711: </a></td><td>			} <span class="php-kw">elseif</span> ((<span class="php-var">$custom_field</span>[<span class="php-str">&#039;type&#039;</span>] == <span class="php-str">&#039;text&#039;</span>) &amp;&amp; !<span class="php-kw">empty</span>(<span class="php-var">$custom_field</span>[<span class="php-str">&#039;validation&#039;</span>]) &amp;&amp; !preg_match(html_entity_decode(<span class="php-var">$custom_field</span>[<span class="php-str">&#039;validation&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>), <span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;custom_field&#039;</span>][<span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>]])) {</td></tr><tr id="712" class="source-line"><td><a class="source-lineNum" href="#712"> 712: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;custom_field_&#039;</span> . <span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>]] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_regex&#039;</span>), <span class="php-var">$custom_field</span>[<span class="php-str">&#039;name&#039;</span>]);</td></tr><tr id="713" class="source-line"><td><a class="source-lineNum" href="#713"> 713: </a></td><td>			}</td></tr><tr id="714" class="source-line"><td><a class="source-lineNum" href="#714"> 714: </a></td><td>		}</td></tr><tr id="715" class="source-line"><td><a class="source-lineNum" href="#715"> 715: </a></td><td></td></tr><tr id="716" class="source-line"><td><a class="source-lineNum" href="#716"> 716: </a></td><td>		<span class="php-kw">if</span> (<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;password&#039;</span>] || (!<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;customer_id&#039;</span>]))) {</td></tr><tr id="717" class="source-line"><td><a class="source-lineNum" href="#717"> 717: </a></td><td>			<span class="php-kw">if</span> ((oc_strlen(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;password&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>)) &lt; <span class="php-num">6</span>) || (oc_strlen(html_entity_decode(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;password&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>)) &gt; <span class="php-num">40</span>)) {</td></tr><tr id="718" class="source-line"><td><a class="source-lineNum" href="#718"> 718: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;password&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_password&#039;</span>);</td></tr><tr id="719" class="source-line"><td><a class="source-lineNum" href="#719"> 719: </a></td><td>			}</td></tr><tr id="720" class="source-line"><td><a class="source-lineNum" href="#720"> 720: </a></td><td></td></tr><tr id="721" class="source-line"><td><a class="source-lineNum" href="#721"> 721: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;password&#039;</span>] != <span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;confirm&#039;</span>]) {</td></tr><tr id="722" class="source-line"><td><a class="source-lineNum" href="#722"> 722: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;confirm&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_confirm&#039;</span>);</td></tr><tr id="723" class="source-line"><td><a class="source-lineNum" href="#723"> 723: </a></td><td>			}</td></tr><tr id="724" class="source-line"><td><a class="source-lineNum" href="#724"> 724: </a></td><td>		}</td></tr><tr id="725" class="source-line"><td><a class="source-lineNum" href="#725"> 725: </a></td><td></td></tr><tr id="726" class="source-line"><td><a class="source-lineNum" href="#726"> 726: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>]) &amp;&amp; !<span class="php-kw">isset</span>(<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;warning&#039;</span>])) {</td></tr><tr id="727" class="source-line"><td><a class="source-lineNum" href="#727"> 727: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>][<span class="php-str">&#039;warning&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_warning&#039;</span>);</td></tr><tr id="728" class="source-line"><td><a class="source-lineNum" href="#728"> 728: </a></td><td>		}</td></tr><tr id="729" class="source-line"><td><a class="source-lineNum" href="#729"> 729: </a></td><td></td></tr><tr id="730" class="source-line"><td><a class="source-lineNum" href="#730"> 730: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="731" class="source-line"><td><a class="source-lineNum" href="#731"> 731: </a></td><td>			<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;customer_id&#039;</span>]) {</td></tr><tr id="732" class="source-line"><td><a class="source-lineNum" href="#732"> 732: </a></td><td>				<span class="php-var">$json</span>[<span class="php-str">&#039;customer_id&#039;</span>] = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;addCustomer(<span class="php-var">$this</span>-&gt;request-&gt;post);</td></tr><tr id="733" class="source-line"><td><a class="source-lineNum" href="#733"> 733: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="734" class="source-line"><td><a class="source-lineNum" href="#734"> 734: </a></td><td>				<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;editCustomer(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;customer_id&#039;</span>], <span class="php-var">$this</span>-&gt;request-&gt;post);</td></tr><tr id="735" class="source-line"><td><a class="source-lineNum" href="#735"> 735: </a></td><td>			}</td></tr><tr id="736" class="source-line"><td><a class="source-lineNum" href="#736"> 736: </a></td><td></td></tr><tr id="737" class="source-line"><td><a class="source-lineNum" href="#737"> 737: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="738" class="source-line"><td><a class="source-lineNum" href="#738"> 738: </a></td><td>		}</td></tr><tr id="739" class="source-line"><td><a class="source-lineNum" href="#739"> 739: </a></td><td></td></tr><tr id="740" class="source-line"><td><a class="source-lineNum" href="#740"> 740: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="741" class="source-line"><td><a class="source-lineNum" href="#741"> 741: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="742" class="source-line"><td><a class="source-lineNum" href="#742"> 742: </a></td><td>	}</td></tr><tr id="743" class="source-line"><td><a class="source-lineNum" href="#743"> 743: </a></td><td></td></tr><tr id="744" class="source-line"><td><a class="source-lineNum" href="#744"> 744: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="745" class="source-line"><td><a class="source-lineNum" href="#745"> 745: </a></td><td><span class="php-comment">	 * Unlock</span></td></tr><tr id="746" class="source-line"><td><a class="source-lineNum" href="#746"> 746: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="747" class="source-line"><td><a class="source-lineNum" href="#747"> 747: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="748" class="source-line"><td><a class="source-lineNum" href="#748"> 748: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="749" class="source-line"><td><a class="source-lineNum" href="#749"> 749: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> unlock(): void {</td></tr><tr id="750" class="source-line"><td><a class="source-lineNum" href="#750"> 750: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="751" class="source-line"><td><a class="source-lineNum" href="#751"> 751: </a></td><td></td></tr><tr id="752" class="source-line"><td><a class="source-lineNum" href="#752"> 752: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="753" class="source-line"><td><a class="source-lineNum" href="#753"> 753: </a></td><td></td></tr><tr id="754" class="source-line"><td><a class="source-lineNum" href="#754"> 754: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="755" class="source-line"><td><a class="source-lineNum" href="#755"> 755: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="756" class="source-line"><td><a class="source-lineNum" href="#756"> 756: </a></td><td>		}</td></tr><tr id="757" class="source-line"><td><a class="source-lineNum" href="#757"> 757: </a></td><td></td></tr><tr id="758" class="source-line"><td><a class="source-lineNum" href="#758"> 758: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">empty</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;email&#039;</span>])) {</td></tr><tr id="759" class="source-line"><td><a class="source-lineNum" href="#759"> 759: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_email&#039;</span>);</td></tr><tr id="760" class="source-line"><td><a class="source-lineNum" href="#760"> 760: </a></td><td>		}</td></tr><tr id="761" class="source-line"><td><a class="source-lineNum" href="#761"> 761: </a></td><td></td></tr><tr id="762" class="source-line"><td><a class="source-lineNum" href="#762"> 762: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="763" class="source-line"><td><a class="source-lineNum" href="#763"> 763: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="764" class="source-line"><td><a class="source-lineNum" href="#764"> 764: </a></td><td></td></tr><tr id="765" class="source-line"><td><a class="source-lineNum" href="#765"> 765: </a></td><td>			<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;deleteLoginAttempts(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;email&#039;</span>]);</td></tr><tr id="766" class="source-line"><td><a class="source-lineNum" href="#766"> 766: </a></td><td></td></tr><tr id="767" class="source-line"><td><a class="source-lineNum" href="#767"> 767: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="768" class="source-line"><td><a class="source-lineNum" href="#768"> 768: </a></td><td>		}</td></tr><tr id="769" class="source-line"><td><a class="source-lineNum" href="#769"> 769: </a></td><td></td></tr><tr id="770" class="source-line"><td><a class="source-lineNum" href="#770"> 770: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="771" class="source-line"><td><a class="source-lineNum" href="#771"> 771: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="772" class="source-line"><td><a class="source-lineNum" href="#772"> 772: </a></td><td>	}</td></tr><tr id="773" class="source-line"><td><a class="source-lineNum" href="#773"> 773: </a></td><td></td></tr><tr id="774" class="source-line"><td><a class="source-lineNum" href="#774"> 774: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="775" class="source-line"><td><a class="source-lineNum" href="#775"> 775: </a></td><td><span class="php-comment">	 * Delete</span></td></tr><tr id="776" class="source-line"><td><a class="source-lineNum" href="#776"> 776: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="777" class="source-line"><td><a class="source-lineNum" href="#777"> 777: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="778" class="source-line"><td><a class="source-lineNum" href="#778"> 778: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="779" class="source-line"><td><a class="source-lineNum" href="#779"> 779: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> delete(): void {</td></tr><tr id="780" class="source-line"><td><a class="source-lineNum" href="#780"> 780: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="781" class="source-line"><td><a class="source-lineNum" href="#781"> 781: </a></td><td></td></tr><tr id="782" class="source-line"><td><a class="source-lineNum" href="#782"> 782: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="783" class="source-line"><td><a class="source-lineNum" href="#783"> 783: </a></td><td></td></tr><tr id="784" class="source-line"><td><a class="source-lineNum" href="#784"> 784: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;selected&#039;</span>])) {</td></tr><tr id="785" class="source-line"><td><a class="source-lineNum" href="#785"> 785: </a></td><td>			<span class="php-var">$selected</span> = <span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;selected&#039;</span>];</td></tr><tr id="786" class="source-line"><td><a class="source-lineNum" href="#786"> 786: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="787" class="source-line"><td><a class="source-lineNum" href="#787"> 787: </a></td><td>			<span class="php-var">$selected</span> = [];</td></tr><tr id="788" class="source-line"><td><a class="source-lineNum" href="#788"> 788: </a></td><td>		}</td></tr><tr id="789" class="source-line"><td><a class="source-lineNum" href="#789"> 789: </a></td><td></td></tr><tr id="790" class="source-line"><td><a class="source-lineNum" href="#790"> 790: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="791" class="source-line"><td><a class="source-lineNum" href="#791"> 791: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="792" class="source-line"><td><a class="source-lineNum" href="#792"> 792: </a></td><td>		}</td></tr><tr id="793" class="source-line"><td><a class="source-lineNum" href="#793"> 793: </a></td><td></td></tr><tr id="794" class="source-line"><td><a class="source-lineNum" href="#794"> 794: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="795" class="source-line"><td><a class="source-lineNum" href="#795"> 795: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="796" class="source-line"><td><a class="source-lineNum" href="#796"> 796: </a></td><td></td></tr><tr id="797" class="source-line"><td><a class="source-lineNum" href="#797"> 797: </a></td><td>			<span class="php-kw">foreach</span> (<span class="php-var">$selected</span> <span class="php-kw">as</span> <span class="php-var">$customer_id</span>) {</td></tr><tr id="798" class="source-line"><td><a class="source-lineNum" href="#798"> 798: </a></td><td>				<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;deleteCustomer(<span class="php-var">$customer_id</span>);</td></tr><tr id="799" class="source-line"><td><a class="source-lineNum" href="#799"> 799: </a></td><td>			}</td></tr><tr id="800" class="source-line"><td><a class="source-lineNum" href="#800"> 800: </a></td><td></td></tr><tr id="801" class="source-line"><td><a class="source-lineNum" href="#801"> 801: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="802" class="source-line"><td><a class="source-lineNum" href="#802"> 802: </a></td><td>		}</td></tr><tr id="803" class="source-line"><td><a class="source-lineNum" href="#803"> 803: </a></td><td></td></tr><tr id="804" class="source-line"><td><a class="source-lineNum" href="#804"> 804: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="805" class="source-line"><td><a class="source-lineNum" href="#805"> 805: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="806" class="source-line"><td><a class="source-lineNum" href="#806"> 806: </a></td><td>	}</td></tr><tr id="807" class="source-line"><td><a class="source-lineNum" href="#807"> 807: </a></td><td></td></tr><tr id="808" class="source-line"><td><a class="source-lineNum" href="#808"> 808: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="809" class="source-line"><td><a class="source-lineNum" href="#809"> 809: </a></td><td><span class="php-comment">	 * Login</span></td></tr><tr id="810" class="source-line"><td><a class="source-lineNum" href="#810"> 810: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="811" class="source-line"><td><a class="source-lineNum" href="#811"> 811: </a></td><td><span class="php-comment">	 * @return \Opencart\System\Engine\Action|null</span></td></tr><tr id="812" class="source-line"><td><a class="source-lineNum" href="#812"> 812: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="813" class="source-line"><td><a class="source-lineNum" href="#813"> 813: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> login(): ?\Opencart\System\Engine\Action {</td></tr><tr id="814" class="source-line"><td><a class="source-lineNum" href="#814"> 814: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="815" class="source-line"><td><a class="source-lineNum" href="#815"> 815: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="816" class="source-line"><td><a class="source-lineNum" href="#816"> 816: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="817" class="source-line"><td><a class="source-lineNum" href="#817"> 817: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="818" class="source-line"><td><a class="source-lineNum" href="#818"> 818: </a></td><td>		}</td></tr><tr id="819" class="source-line"><td><a class="source-lineNum" href="#819"> 819: </a></td><td></td></tr><tr id="820" class="source-line"><td><a class="source-lineNum" href="#820"> 820: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="821" class="source-line"><td><a class="source-lineNum" href="#821"> 821: </a></td><td></td></tr><tr id="822" class="source-line"><td><a class="source-lineNum" href="#822"> 822: </a></td><td>		<span class="php-var">$customer_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomer(<span class="php-var">$customer_id</span>);</td></tr><tr id="823" class="source-line"><td><a class="source-lineNum" href="#823"> 823: </a></td><td></td></tr><tr id="824" class="source-line"><td><a class="source-lineNum" href="#824"> 824: </a></td><td>		<span class="php-kw">if</span> (<span class="php-var">$customer_info</span>) {</td></tr><tr id="825" class="source-line"><td><a class="source-lineNum" href="#825"> 825: </a></td><td>			<span class="php-comment">// Create token to login with</span></td></tr><tr id="826" class="source-line"><td><a class="source-lineNum" href="#826"> 826: </a></td><td>			<span class="php-var">$token</span> = oc_token(<span class="php-num">64</span>);</td></tr><tr id="827" class="source-line"><td><a class="source-lineNum" href="#827"> 827: </a></td><td></td></tr><tr id="828" class="source-line"><td><a class="source-lineNum" href="#828"> 828: </a></td><td>			<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;editToken(<span class="php-var">$customer_id</span>, <span class="php-var">$token</span>);</td></tr><tr id="829" class="source-line"><td><a class="source-lineNum" href="#829"> 829: </a></td><td></td></tr><tr id="830" class="source-line"><td><a class="source-lineNum" href="#830"> 830: </a></td><td>			<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;store_id&#039;</span>])) {</td></tr><tr id="831" class="source-line"><td><a class="source-lineNum" href="#831"> 831: </a></td><td>				<span class="php-var">$store_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;store_id&#039;</span>];</td></tr><tr id="832" class="source-line"><td><a class="source-lineNum" href="#832"> 832: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="833" class="source-line"><td><a class="source-lineNum" href="#833"> 833: </a></td><td>				<span class="php-var">$store_id</span> = <span class="php-num">0</span>;</td></tr><tr id="834" class="source-line"><td><a class="source-lineNum" href="#834"> 834: </a></td><td>			}</td></tr><tr id="835" class="source-line"><td><a class="source-lineNum" href="#835"> 835: </a></td><td></td></tr><tr id="836" class="source-line"><td><a class="source-lineNum" href="#836"> 836: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;setting/store&#039;</span>);</td></tr><tr id="837" class="source-line"><td><a class="source-lineNum" href="#837"> 837: </a></td><td></td></tr><tr id="838" class="source-line"><td><a class="source-lineNum" href="#838"> 838: </a></td><td>			<span class="php-var">$store_info</span> = <span class="php-var">$this</span>-&gt;model_setting_store-&gt;getStore(<span class="php-var">$store_id</span>);</td></tr><tr id="839" class="source-line"><td><a class="source-lineNum" href="#839"> 839: </a></td><td></td></tr><tr id="840" class="source-line"><td><a class="source-lineNum" href="#840"> 840: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$store_info</span>) {</td></tr><tr id="841" class="source-line"><td><a class="source-lineNum" href="#841"> 841: </a></td><td>				<span class="php-var">$this</span>-&gt;response-&gt;redirect(<span class="php-var">$store_info</span>[<span class="php-str">&#039;url&#039;</span>] . <span class="php-str">&#039;index.php?route=account/login.token&amp;email=&#039;</span> . urlencode(<span class="php-var">$customer_info</span>[<span class="php-str">&#039;email&#039;</span>]) . <span class="php-str">&#039;&amp;login_token=&#039;</span> . <span class="php-var">$token</span>);</td></tr><tr id="842" class="source-line"><td><a class="source-lineNum" href="#842"> 842: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="843" class="source-line"><td><a class="source-lineNum" href="#843"> 843: </a></td><td>				<span class="php-var">$this</span>-&gt;response-&gt;redirect(HTTP_CATALOG . <span class="php-str">&#039;index.php?route=account/login.token&amp;email=&#039;</span> . urlencode(<span class="php-var">$customer_info</span>[<span class="php-str">&#039;email&#039;</span>]) . <span class="php-str">&#039;&amp;login_token=&#039;</span> . <span class="php-var">$token</span>);</td></tr><tr id="844" class="source-line"><td><a class="source-lineNum" href="#844"> 844: </a></td><td>			}</td></tr><tr id="845" class="source-line"><td><a class="source-lineNum" href="#845"> 845: </a></td><td></td></tr><tr id="846" class="source-line"><td><a class="source-lineNum" href="#846"> 846: </a></td><td>			<span class="php-kw">return</span> <span class="php-kw">null</span>;</td></tr><tr id="847" class="source-line"><td><a class="source-lineNum" href="#847"> 847: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="848" class="source-line"><td><a class="source-lineNum" href="#848"> 848: </a></td><td>			<span class="php-kw">return</span> <span class="php-kw">new</span> \Opencart\System\Engine\Action(<span class="php-str">&#039;error/not_found&#039;</span>);</td></tr><tr id="849" class="source-line"><td><a class="source-lineNum" href="#849"> 849: </a></td><td>		}</td></tr><tr id="850" class="source-line"><td><a class="source-lineNum" href="#850"> 850: </a></td><td>	}</td></tr><tr id="851" class="source-line"><td><a class="source-lineNum" href="#851"> 851: </a></td><td></td></tr><tr id="852" class="source-line"><td><a class="source-lineNum" href="#852"> 852: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="853" class="source-line"><td><a class="source-lineNum" href="#853"> 853: </a></td><td><span class="php-comment">	 * Payment</span></td></tr><tr id="854" class="source-line"><td><a class="source-lineNum" href="#854"> 854: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="855" class="source-line"><td><a class="source-lineNum" href="#855"> 855: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="856" class="source-line"><td><a class="source-lineNum" href="#856"> 856: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="857" class="source-line"><td><a class="source-lineNum" href="#857"> 857: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> payment(): void {</td></tr><tr id="858" class="source-line"><td><a class="source-lineNum" href="#858"> 858: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="859" class="source-line"><td><a class="source-lineNum" href="#859"> 859: </a></td><td></td></tr><tr id="860" class="source-line"><td><a class="source-lineNum" href="#860"> 860: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getPayment());</td></tr><tr id="861" class="source-line"><td><a class="source-lineNum" href="#861"> 861: </a></td><td>	}</td></tr><tr id="862" class="source-line"><td><a class="source-lineNum" href="#862"> 862: </a></td><td></td></tr><tr id="863" class="source-line"><td><a class="source-lineNum" href="#863"> 863: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="864" class="source-line"><td><a class="source-lineNum" href="#864"> 864: </a></td><td><span class="php-comment">	 * Get Payment</span></td></tr><tr id="865" class="source-line"><td><a class="source-lineNum" href="#865"> 865: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="866" class="source-line"><td><a class="source-lineNum" href="#866"> 866: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="867" class="source-line"><td><a class="source-lineNum" href="#867"> 867: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="868" class="source-line"><td><a class="source-lineNum" href="#868"> 868: </a></td><td>	<span class="php-kw">private</span> <span class="php-kw">function</span> getPayment(): string {</td></tr><tr id="869" class="source-line"><td><a class="source-lineNum" href="#869"> 869: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="870" class="source-line"><td><a class="source-lineNum" href="#870"> 870: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="871" class="source-line"><td><a class="source-lineNum" href="#871"> 871: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="872" class="source-line"><td><a class="source-lineNum" href="#872"> 872: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="873" class="source-line"><td><a class="source-lineNum" href="#873"> 873: </a></td><td>		}</td></tr><tr id="874" class="source-line"><td><a class="source-lineNum" href="#874"> 874: </a></td><td></td></tr><tr id="875" class="source-line"><td><a class="source-lineNum" href="#875"> 875: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>]) &amp;&amp; <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;route&#039;</span>] == <span class="php-str">&#039;customer/customer.payment&#039;</span>) {</td></tr><tr id="876" class="source-line"><td><a class="source-lineNum" href="#876"> 876: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="877" class="source-line"><td><a class="source-lineNum" href="#877"> 877: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="878" class="source-line"><td><a class="source-lineNum" href="#878"> 878: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="879" class="source-line"><td><a class="source-lineNum" href="#879"> 879: </a></td><td>		}</td></tr><tr id="880" class="source-line"><td><a class="source-lineNum" href="#880"> 880: </a></td><td></td></tr><tr id="881" class="source-line"><td><a class="source-lineNum" href="#881"> 881: </a></td><td>		<span class="php-var">$limit</span> = <span class="php-num">10</span>;</td></tr><tr id="882" class="source-line"><td><a class="source-lineNum" href="#882"> 882: </a></td><td></td></tr><tr id="883" class="source-line"><td><a class="source-lineNum" href="#883"> 883: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;payment_methods&#039;</span>] = [];</td></tr><tr id="884" class="source-line"><td><a class="source-lineNum" href="#884"> 884: </a></td><td></td></tr><tr id="885" class="source-line"><td><a class="source-lineNum" href="#885"> 885: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;sale/subscription&#039;</span>);</td></tr><tr id="886" class="source-line"><td><a class="source-lineNum" href="#886"> 886: </a></td><td></td></tr><tr id="887" class="source-line"><td><a class="source-lineNum" href="#887"> 887: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_sale_subscription-&gt;getSubscriptions([<span class="php-str">&#039;filter_customer_id&#039;</span> =&gt; <span class="php-var">$customer_id</span>]);</td></tr><tr id="888" class="source-line"><td><a class="source-lineNum" href="#888"> 888: </a></td><td></td></tr><tr id="889" class="source-line"><td><a class="source-lineNum" href="#889"> 889: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="890" class="source-line"><td><a class="source-lineNum" href="#890"> 890: </a></td><td>			<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$result</span>[<span class="php-str">&#039;image&#039;</span>])) {</td></tr><tr id="891" class="source-line"><td><a class="source-lineNum" href="#891"> 891: </a></td><td>				<span class="php-var">$image</span> = DIR_IMAGE . <span class="php-str">&#039;payment/&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;image&#039;</span>];</td></tr><tr id="892" class="source-line"><td><a class="source-lineNum" href="#892"> 892: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="893" class="source-line"><td><a class="source-lineNum" href="#893"> 893: </a></td><td>				<span class="php-var">$image</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="894" class="source-line"><td><a class="source-lineNum" href="#894"> 894: </a></td><td>			}</td></tr><tr id="895" class="source-line"><td><a class="source-lineNum" href="#895"> 895: </a></td><td></td></tr><tr id="896" class="source-line"><td><a class="source-lineNum" href="#896"> 896: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;payment_methods&#039;</span>][] = [</td></tr><tr id="897" class="source-line"><td><a class="source-lineNum" href="#897"> 897: </a></td><td>				<span class="php-str">&#039;customer_payment_id&#039;</span> =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;customer_payment_id&#039;</span>],</td></tr><tr id="898" class="source-line"><td><a class="source-lineNum" href="#898"> 898: </a></td><td>				<span class="php-str">&#039;name&#039;</span>                =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;name&#039;</span>],</td></tr><tr id="899" class="source-line"><td><a class="source-lineNum" href="#899"> 899: </a></td><td>				<span class="php-str">&#039;image&#039;</span>               =&gt; <span class="php-var">$image</span>,</td></tr><tr id="900" class="source-line"><td><a class="source-lineNum" href="#900"> 900: </a></td><td>				<span class="php-str">&#039;type&#039;</span>                =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;type&#039;</span>],</td></tr><tr id="901" class="source-line"><td><a class="source-lineNum" href="#901"> 901: </a></td><td>				<span class="php-str">&#039;status&#039;</span>              =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;status&#039;</span>],</td></tr><tr id="902" class="source-line"><td><a class="source-lineNum" href="#902"> 902: </a></td><td>				<span class="php-str">&#039;date_expire&#039;</span>         =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;date_format_short&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_expire&#039;</span>])),</td></tr><tr id="903" class="source-line"><td><a class="source-lineNum" href="#903"> 903: </a></td><td>				<span class="php-str">&#039;delete&#039;</span>              =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.deletePayment&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_payment_id=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;customer_payment_id&#039;</span>])</td></tr><tr id="904" class="source-line"><td><a class="source-lineNum" href="#904"> 904: </a></td><td>			];</td></tr><tr id="905" class="source-line"><td><a class="source-lineNum" href="#905"> 905: </a></td><td>		}</td></tr><tr id="906" class="source-line"><td><a class="source-lineNum" href="#906"> 906: </a></td><td></td></tr><tr id="907" class="source-line"><td><a class="source-lineNum" href="#907"> 907: </a></td><td>		<span class="php-var">$payment_total</span> = <span class="php-var">$this</span>-&gt;model_sale_subscription-&gt;getTotalSubscriptions([<span class="php-str">&#039;filter_customer_id&#039;</span> =&gt; <span class="php-var">$customer_id</span>]);</td></tr><tr id="908" class="source-line"><td><a class="source-lineNum" href="#908"> 908: </a></td><td></td></tr><tr id="909" class="source-line"><td><a class="source-lineNum" href="#909"> 909: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="910" class="source-line"><td><a class="source-lineNum" href="#910"> 910: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$payment_total</span>,</td></tr><tr id="911" class="source-line"><td><a class="source-lineNum" href="#911"> 911: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="912" class="source-line"><td><a class="source-lineNum" href="#912"> 912: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$limit</span>,</td></tr><tr id="913" class="source-line"><td><a class="source-lineNum" href="#913"> 913: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.payment&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$customer_id</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="914" class="source-line"><td><a class="source-lineNum" href="#914"> 914: </a></td><td>		]);</td></tr><tr id="915" class="source-line"><td><a class="source-lineNum" href="#915"> 915: </a></td><td></td></tr><tr id="916" class="source-line"><td><a class="source-lineNum" href="#916"> 916: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$payment_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) &gt; (<span class="php-var">$payment_total</span> - <span class="php-var">$limit</span>)) ? <span class="php-var">$payment_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-var">$limit</span>), <span class="php-var">$payment_total</span>, ceil(<span class="php-var">$payment_total</span> / <span class="php-var">$limit</span>));</td></tr><tr id="917" class="source-line"><td><a class="source-lineNum" href="#917"> 917: </a></td><td></td></tr><tr id="918" class="source-line"><td><a class="source-lineNum" href="#918"> 918: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_payment&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="919" class="source-line"><td><a class="source-lineNum" href="#919"> 919: </a></td><td>	}</td></tr><tr id="920" class="source-line"><td><a class="source-lineNum" href="#920"> 920: </a></td><td></td></tr><tr id="921" class="source-line"><td><a class="source-lineNum" href="#921"> 921: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="922" class="source-line"><td><a class="source-lineNum" href="#922"> 922: </a></td><td><span class="php-comment">	 * Delete Payment</span></td></tr><tr id="923" class="source-line"><td><a class="source-lineNum" href="#923"> 923: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="924" class="source-line"><td><a class="source-lineNum" href="#924"> 924: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="925" class="source-line"><td><a class="source-lineNum" href="#925"> 925: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="926" class="source-line"><td><a class="source-lineNum" href="#926"> 926: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> deletePayment(): void {</td></tr><tr id="927" class="source-line"><td><a class="source-lineNum" href="#927"> 927: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="928" class="source-line"><td><a class="source-lineNum" href="#928"> 928: </a></td><td></td></tr><tr id="929" class="source-line"><td><a class="source-lineNum" href="#929"> 929: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="930" class="source-line"><td><a class="source-lineNum" href="#930"> 930: </a></td><td></td></tr><tr id="931" class="source-line"><td><a class="source-lineNum" href="#931"> 931: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_payment_id&#039;</span>])) {</td></tr><tr id="932" class="source-line"><td><a class="source-lineNum" href="#932"> 932: </a></td><td>			<span class="php-var">$customer_payment_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_payment_id&#039;</span>];</td></tr><tr id="933" class="source-line"><td><a class="source-lineNum" href="#933"> 933: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="934" class="source-line"><td><a class="source-lineNum" href="#934"> 934: </a></td><td>			<span class="php-var">$customer_payment_id</span> = <span class="php-num">0</span>;</td></tr><tr id="935" class="source-line"><td><a class="source-lineNum" href="#935"> 935: </a></td><td>		}</td></tr><tr id="936" class="source-line"><td><a class="source-lineNum" href="#936"> 936: </a></td><td></td></tr><tr id="937" class="source-line"><td><a class="source-lineNum" href="#937"> 937: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="938" class="source-line"><td><a class="source-lineNum" href="#938"> 938: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="939" class="source-line"><td><a class="source-lineNum" href="#939"> 939: </a></td><td>		}</td></tr><tr id="940" class="source-line"><td><a class="source-lineNum" href="#940"> 940: </a></td><td></td></tr><tr id="941" class="source-line"><td><a class="source-lineNum" href="#941"> 941: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="942" class="source-line"><td><a class="source-lineNum" href="#942"> 942: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;sale/subscription&#039;</span>);</td></tr><tr id="943" class="source-line"><td><a class="source-lineNum" href="#943"> 943: </a></td><td></td></tr><tr id="944" class="source-line"><td><a class="source-lineNum" href="#944"> 944: </a></td><td>			<span class="php-var">$this</span>-&gt;model_sale_subscription-&gt;deleteSubscriptionByCustomerPaymentId(<span class="php-var">$customer_payment_id</span>);</td></tr><tr id="945" class="source-line"><td><a class="source-lineNum" href="#945"> 945: </a></td><td></td></tr><tr id="946" class="source-line"><td><a class="source-lineNum" href="#946"> 946: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="947" class="source-line"><td><a class="source-lineNum" href="#947"> 947: </a></td><td>		}</td></tr><tr id="948" class="source-line"><td><a class="source-lineNum" href="#948"> 948: </a></td><td></td></tr><tr id="949" class="source-line"><td><a class="source-lineNum" href="#949"> 949: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="950" class="source-line"><td><a class="source-lineNum" href="#950"> 950: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="951" class="source-line"><td><a class="source-lineNum" href="#951"> 951: </a></td><td>	}</td></tr><tr id="952" class="source-line"><td><a class="source-lineNum" href="#952"> 952: </a></td><td></td></tr><tr id="953" class="source-line"><td><a class="source-lineNum" href="#953"> 953: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="954" class="source-line"><td><a class="source-lineNum" href="#954"> 954: </a></td><td><span class="php-comment">	 * History</span></td></tr><tr id="955" class="source-line"><td><a class="source-lineNum" href="#955"> 955: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="956" class="source-line"><td><a class="source-lineNum" href="#956"> 956: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="957" class="source-line"><td><a class="source-lineNum" href="#957"> 957: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="958" class="source-line"><td><a class="source-lineNum" href="#958"> 958: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> history(): void {</td></tr><tr id="959" class="source-line"><td><a class="source-lineNum" href="#959"> 959: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="960" class="source-line"><td><a class="source-lineNum" href="#960"> 960: </a></td><td></td></tr><tr id="961" class="source-line"><td><a class="source-lineNum" href="#961"> 961: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getHistory());</td></tr><tr id="962" class="source-line"><td><a class="source-lineNum" href="#962"> 962: </a></td><td>	}</td></tr><tr id="963" class="source-line"><td><a class="source-lineNum" href="#963"> 963: </a></td><td></td></tr><tr id="964" class="source-line"><td><a class="source-lineNum" href="#964"> 964: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="965" class="source-line"><td><a class="source-lineNum" href="#965"> 965: </a></td><td><span class="php-comment">	 * Get History</span></td></tr><tr id="966" class="source-line"><td><a class="source-lineNum" href="#966"> 966: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="967" class="source-line"><td><a class="source-lineNum" href="#967"> 967: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="968" class="source-line"><td><a class="source-lineNum" href="#968"> 968: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="969" class="source-line"><td><a class="source-lineNum" href="#969"> 969: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> getHistory(): string {</td></tr><tr id="970" class="source-line"><td><a class="source-lineNum" href="#970"> 970: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="971" class="source-line"><td><a class="source-lineNum" href="#971"> 971: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="972" class="source-line"><td><a class="source-lineNum" href="#972"> 972: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="973" class="source-line"><td><a class="source-lineNum" href="#973"> 973: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="974" class="source-line"><td><a class="source-lineNum" href="#974"> 974: </a></td><td>		}</td></tr><tr id="975" class="source-line"><td><a class="source-lineNum" href="#975"> 975: </a></td><td></td></tr><tr id="976" class="source-line"><td><a class="source-lineNum" href="#976"> 976: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>]) &amp;&amp; <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;route&#039;</span>] == <span class="php-str">&#039;customer/customer.history&#039;</span>) {</td></tr><tr id="977" class="source-line"><td><a class="source-lineNum" href="#977"> 977: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="978" class="source-line"><td><a class="source-lineNum" href="#978"> 978: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="979" class="source-line"><td><a class="source-lineNum" href="#979"> 979: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="980" class="source-line"><td><a class="source-lineNum" href="#980"> 980: </a></td><td>		}</td></tr><tr id="981" class="source-line"><td><a class="source-lineNum" href="#981"> 981: </a></td><td></td></tr><tr id="982" class="source-line"><td><a class="source-lineNum" href="#982"> 982: </a></td><td>		<span class="php-var">$limit</span> = <span class="php-num">10</span>;</td></tr><tr id="983" class="source-line"><td><a class="source-lineNum" href="#983"> 983: </a></td><td></td></tr><tr id="984" class="source-line"><td><a class="source-lineNum" href="#984"> 984: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;histories&#039;</span>] = [];</td></tr><tr id="985" class="source-line"><td><a class="source-lineNum" href="#985"> 985: </a></td><td></td></tr><tr id="986" class="source-line"><td><a class="source-lineNum" href="#986"> 986: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="987" class="source-line"><td><a class="source-lineNum" href="#987"> 987: </a></td><td></td></tr><tr id="988" class="source-line"><td><a class="source-lineNum" href="#988"> 988: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getHistories(<span class="php-var">$customer_id</span>, (<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>, <span class="php-var">$limit</span>);</td></tr><tr id="989" class="source-line"><td><a class="source-lineNum" href="#989"> 989: </a></td><td></td></tr><tr id="990" class="source-line"><td><a class="source-lineNum" href="#990"> 990: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="991" class="source-line"><td><a class="source-lineNum" href="#991"> 991: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;histories&#039;</span>][] = [</td></tr><tr id="992" class="source-line"><td><a class="source-lineNum" href="#992"> 992: </a></td><td>				<span class="php-str">&#039;comment&#039;</span>    =&gt; nl2br(<span class="php-var">$result</span>[<span class="php-str">&#039;comment&#039;</span>]),</td></tr><tr id="993" class="source-line"><td><a class="source-lineNum" href="#993"> 993: </a></td><td>				<span class="php-str">&#039;date_added&#039;</span> =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;date_format_short&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_added&#039;</span>]))</td></tr><tr id="994" class="source-line"><td><a class="source-lineNum" href="#994"> 994: </a></td><td>			];</td></tr><tr id="995" class="source-line"><td><a class="source-lineNum" href="#995"> 995: </a></td><td>		}</td></tr><tr id="996" class="source-line"><td><a class="source-lineNum" href="#996"> 996: </a></td><td></td></tr><tr id="997" class="source-line"><td><a class="source-lineNum" href="#997"> 997: </a></td><td>		<span class="php-var">$history_total</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalHistories(<span class="php-var">$customer_id</span>);</td></tr><tr id="998" class="source-line"><td><a class="source-lineNum" href="#998"> 998: </a></td><td></td></tr><tr id="999" class="source-line"><td><a class="source-lineNum" href="#999"> 999: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="1000" class="source-line"><td><a class="source-lineNum" href="#1000">1000: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$history_total</span>,</td></tr><tr id="1001" class="source-line"><td><a class="source-lineNum" href="#1001">1001: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="1002" class="source-line"><td><a class="source-lineNum" href="#1002">1002: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$limit</span>,</td></tr><tr id="1003" class="source-line"><td><a class="source-lineNum" href="#1003">1003: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.history&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$customer_id</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="1004" class="source-line"><td><a class="source-lineNum" href="#1004">1004: </a></td><td>		]);</td></tr><tr id="1005" class="source-line"><td><a class="source-lineNum" href="#1005">1005: </a></td><td></td></tr><tr id="1006" class="source-line"><td><a class="source-lineNum" href="#1006">1006: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$history_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) &gt; (<span class="php-var">$history_total</span> - <span class="php-var">$limit</span>)) ? <span class="php-var">$history_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-var">$limit</span>), <span class="php-var">$history_total</span>, ceil(<span class="php-var">$history_total</span> / <span class="php-var">$limit</span>));</td></tr><tr id="1007" class="source-line"><td><a class="source-lineNum" href="#1007">1007: </a></td><td></td></tr><tr id="1008" class="source-line"><td><a class="source-lineNum" href="#1008">1008: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_history&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="1009" class="source-line"><td><a class="source-lineNum" href="#1009">1009: </a></td><td>	}</td></tr><tr id="1010" class="source-line"><td><a class="source-lineNum" href="#1010">1010: </a></td><td></td></tr><tr id="1011" class="source-line"><td><a class="source-lineNum" href="#1011">1011: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1012" class="source-line"><td><a class="source-lineNum" href="#1012">1012: </a></td><td><span class="php-comment">	 * Add History</span></td></tr><tr id="1013" class="source-line"><td><a class="source-lineNum" href="#1013">1013: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1014" class="source-line"><td><a class="source-lineNum" href="#1014">1014: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1015" class="source-line"><td><a class="source-lineNum" href="#1015">1015: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1016" class="source-line"><td><a class="source-lineNum" href="#1016">1016: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> addHistory(): void {</td></tr><tr id="1017" class="source-line"><td><a class="source-lineNum" href="#1017">1017: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1018" class="source-line"><td><a class="source-lineNum" href="#1018">1018: </a></td><td></td></tr><tr id="1019" class="source-line"><td><a class="source-lineNum" href="#1019">1019: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="1020" class="source-line"><td><a class="source-lineNum" href="#1020">1020: </a></td><td></td></tr><tr id="1021" class="source-line"><td><a class="source-lineNum" href="#1021">1021: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1022" class="source-line"><td><a class="source-lineNum" href="#1022">1022: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1023" class="source-line"><td><a class="source-lineNum" href="#1023">1023: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1024" class="source-line"><td><a class="source-lineNum" href="#1024">1024: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1025" class="source-line"><td><a class="source-lineNum" href="#1025">1025: </a></td><td>		}</td></tr><tr id="1026" class="source-line"><td><a class="source-lineNum" href="#1026">1026: </a></td><td></td></tr><tr id="1027" class="source-line"><td><a class="source-lineNum" href="#1027">1027: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="1028" class="source-line"><td><a class="source-lineNum" href="#1028">1028: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="1029" class="source-line"><td><a class="source-lineNum" href="#1029">1029: </a></td><td>		}</td></tr><tr id="1030" class="source-line"><td><a class="source-lineNum" href="#1030">1030: </a></td><td></td></tr><tr id="1031" class="source-line"><td><a class="source-lineNum" href="#1031">1031: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1032" class="source-line"><td><a class="source-lineNum" href="#1032">1032: </a></td><td></td></tr><tr id="1033" class="source-line"><td><a class="source-lineNum" href="#1033">1033: </a></td><td>		<span class="php-var">$customer_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomer(<span class="php-var">$customer_id</span>);</td></tr><tr id="1034" class="source-line"><td><a class="source-lineNum" href="#1034">1034: </a></td><td></td></tr><tr id="1035" class="source-line"><td><a class="source-lineNum" href="#1035">1035: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$customer_info</span>) {</td></tr><tr id="1036" class="source-line"><td><a class="source-lineNum" href="#1036">1036: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_customer&#039;</span>);</td></tr><tr id="1037" class="source-line"><td><a class="source-lineNum" href="#1037">1037: </a></td><td>		}</td></tr><tr id="1038" class="source-line"><td><a class="source-lineNum" href="#1038">1038: </a></td><td></td></tr><tr id="1039" class="source-line"><td><a class="source-lineNum" href="#1039">1039: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="1040" class="source-line"><td><a class="source-lineNum" href="#1040">1040: </a></td><td>			<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;addHistory(<span class="php-var">$customer_id</span>, <span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;comment&#039;</span>]);</td></tr><tr id="1041" class="source-line"><td><a class="source-lineNum" href="#1041">1041: </a></td><td></td></tr><tr id="1042" class="source-line"><td><a class="source-lineNum" href="#1042">1042: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="1043" class="source-line"><td><a class="source-lineNum" href="#1043">1043: </a></td><td>		}</td></tr><tr id="1044" class="source-line"><td><a class="source-lineNum" href="#1044">1044: </a></td><td></td></tr><tr id="1045" class="source-line"><td><a class="source-lineNum" href="#1045">1045: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="1046" class="source-line"><td><a class="source-lineNum" href="#1046">1046: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="1047" class="source-line"><td><a class="source-lineNum" href="#1047">1047: </a></td><td>	}</td></tr><tr id="1048" class="source-line"><td><a class="source-lineNum" href="#1048">1048: </a></td><td></td></tr><tr id="1049" class="source-line"><td><a class="source-lineNum" href="#1049">1049: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1050" class="source-line"><td><a class="source-lineNum" href="#1050">1050: </a></td><td><span class="php-comment">	 * Transaction</span></td></tr><tr id="1051" class="source-line"><td><a class="source-lineNum" href="#1051">1051: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1052" class="source-line"><td><a class="source-lineNum" href="#1052">1052: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1053" class="source-line"><td><a class="source-lineNum" href="#1053">1053: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1054" class="source-line"><td><a class="source-lineNum" href="#1054">1054: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> transaction(): void {</td></tr><tr id="1055" class="source-line"><td><a class="source-lineNum" href="#1055">1055: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1056" class="source-line"><td><a class="source-lineNum" href="#1056">1056: </a></td><td></td></tr><tr id="1057" class="source-line"><td><a class="source-lineNum" href="#1057">1057: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getTransaction());</td></tr><tr id="1058" class="source-line"><td><a class="source-lineNum" href="#1058">1058: </a></td><td>	}</td></tr><tr id="1059" class="source-line"><td><a class="source-lineNum" href="#1059">1059: </a></td><td></td></tr><tr id="1060" class="source-line"><td><a class="source-lineNum" href="#1060">1060: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1061" class="source-line"><td><a class="source-lineNum" href="#1061">1061: </a></td><td><span class="php-comment">	 * Get Transaction</span></td></tr><tr id="1062" class="source-line"><td><a class="source-lineNum" href="#1062">1062: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1063" class="source-line"><td><a class="source-lineNum" href="#1063">1063: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="1064" class="source-line"><td><a class="source-lineNum" href="#1064">1064: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1065" class="source-line"><td><a class="source-lineNum" href="#1065">1065: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> getTransaction(): string {</td></tr><tr id="1066" class="source-line"><td><a class="source-lineNum" href="#1066">1066: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1067" class="source-line"><td><a class="source-lineNum" href="#1067">1067: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1068" class="source-line"><td><a class="source-lineNum" href="#1068">1068: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1069" class="source-line"><td><a class="source-lineNum" href="#1069">1069: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1070" class="source-line"><td><a class="source-lineNum" href="#1070">1070: </a></td><td>		}</td></tr><tr id="1071" class="source-line"><td><a class="source-lineNum" href="#1071">1071: </a></td><td></td></tr><tr id="1072" class="source-line"><td><a class="source-lineNum" href="#1072">1072: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>]) &amp;&amp; <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;route&#039;</span>] == <span class="php-str">&#039;customer/customer.transaction&#039;</span>) {</td></tr><tr id="1073" class="source-line"><td><a class="source-lineNum" href="#1073">1073: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="1074" class="source-line"><td><a class="source-lineNum" href="#1074">1074: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1075" class="source-line"><td><a class="source-lineNum" href="#1075">1075: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="1076" class="source-line"><td><a class="source-lineNum" href="#1076">1076: </a></td><td>		}</td></tr><tr id="1077" class="source-line"><td><a class="source-lineNum" href="#1077">1077: </a></td><td></td></tr><tr id="1078" class="source-line"><td><a class="source-lineNum" href="#1078">1078: </a></td><td>		<span class="php-var">$limit</span> = <span class="php-num">10</span>;</td></tr><tr id="1079" class="source-line"><td><a class="source-lineNum" href="#1079">1079: </a></td><td></td></tr><tr id="1080" class="source-line"><td><a class="source-lineNum" href="#1080">1080: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;transactions&#039;</span>] = [];</td></tr><tr id="1081" class="source-line"><td><a class="source-lineNum" href="#1081">1081: </a></td><td></td></tr><tr id="1082" class="source-line"><td><a class="source-lineNum" href="#1082">1082: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1083" class="source-line"><td><a class="source-lineNum" href="#1083">1083: </a></td><td></td></tr><tr id="1084" class="source-line"><td><a class="source-lineNum" href="#1084">1084: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTransactions(<span class="php-var">$customer_id</span>, (<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>, <span class="php-var">$limit</span>);</td></tr><tr id="1085" class="source-line"><td><a class="source-lineNum" href="#1085">1085: </a></td><td></td></tr><tr id="1086" class="source-line"><td><a class="source-lineNum" href="#1086">1086: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="1087" class="source-line"><td><a class="source-lineNum" href="#1087">1087: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;transactions&#039;</span>][] = [</td></tr><tr id="1088" class="source-line"><td><a class="source-lineNum" href="#1088">1088: </a></td><td>				<span class="php-str">&#039;amount&#039;</span>      =&gt; <span class="php-var">$this</span>-&gt;currency-&gt;format(<span class="php-var">$result</span>[<span class="php-str">&#039;amount&#039;</span>], <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_currency&#039;</span>)),</td></tr><tr id="1089" class="source-line"><td><a class="source-lineNum" href="#1089">1089: </a></td><td>				<span class="php-str">&#039;description&#039;</span> =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;description&#039;</span>],</td></tr><tr id="1090" class="source-line"><td><a class="source-lineNum" href="#1090">1090: </a></td><td>				<span class="php-str">&#039;date_added&#039;</span>  =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;date_format_short&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_added&#039;</span>]))</td></tr><tr id="1091" class="source-line"><td><a class="source-lineNum" href="#1091">1091: </a></td><td>			];</td></tr><tr id="1092" class="source-line"><td><a class="source-lineNum" href="#1092">1092: </a></td><td>		}</td></tr><tr id="1093" class="source-line"><td><a class="source-lineNum" href="#1093">1093: </a></td><td></td></tr><tr id="1094" class="source-line"><td><a class="source-lineNum" href="#1094">1094: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;balance&#039;</span>] = <span class="php-var">$this</span>-&gt;currency-&gt;format(<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTransactionTotal(<span class="php-var">$customer_id</span>), <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_currency&#039;</span>));</td></tr><tr id="1095" class="source-line"><td><a class="source-lineNum" href="#1095">1095: </a></td><td></td></tr><tr id="1096" class="source-line"><td><a class="source-lineNum" href="#1096">1096: </a></td><td>		<span class="php-var">$transaction_total</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalTransactions(<span class="php-var">$customer_id</span>);</td></tr><tr id="1097" class="source-line"><td><a class="source-lineNum" href="#1097">1097: </a></td><td></td></tr><tr id="1098" class="source-line"><td><a class="source-lineNum" href="#1098">1098: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="1099" class="source-line"><td><a class="source-lineNum" href="#1099">1099: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$transaction_total</span>,</td></tr><tr id="1100" class="source-line"><td><a class="source-lineNum" href="#1100">1100: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="1101" class="source-line"><td><a class="source-lineNum" href="#1101">1101: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$limit</span>,</td></tr><tr id="1102" class="source-line"><td><a class="source-lineNum" href="#1102">1102: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.transaction&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$customer_id</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="1103" class="source-line"><td><a class="source-lineNum" href="#1103">1103: </a></td><td>		]);</td></tr><tr id="1104" class="source-line"><td><a class="source-lineNum" href="#1104">1104: </a></td><td></td></tr><tr id="1105" class="source-line"><td><a class="source-lineNum" href="#1105">1105: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$transaction_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) &gt; (<span class="php-var">$transaction_total</span> - <span class="php-var">$limit</span>)) ? <span class="php-var">$transaction_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-var">$limit</span>), <span class="php-var">$transaction_total</span>, ceil(<span class="php-var">$transaction_total</span> / <span class="php-var">$limit</span>));</td></tr><tr id="1106" class="source-line"><td><a class="source-lineNum" href="#1106">1106: </a></td><td></td></tr><tr id="1107" class="source-line"><td><a class="source-lineNum" href="#1107">1107: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_transaction&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="1108" class="source-line"><td><a class="source-lineNum" href="#1108">1108: </a></td><td>	}</td></tr><tr id="1109" class="source-line"><td><a class="source-lineNum" href="#1109">1109: </a></td><td></td></tr><tr id="1110" class="source-line"><td><a class="source-lineNum" href="#1110">1110: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1111" class="source-line"><td><a class="source-lineNum" href="#1111">1111: </a></td><td><span class="php-comment">	 * Add Transaction</span></td></tr><tr id="1112" class="source-line"><td><a class="source-lineNum" href="#1112">1112: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1113" class="source-line"><td><a class="source-lineNum" href="#1113">1113: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1114" class="source-line"><td><a class="source-lineNum" href="#1114">1114: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1115" class="source-line"><td><a class="source-lineNum" href="#1115">1115: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> addTransaction(): void {</td></tr><tr id="1116" class="source-line"><td><a class="source-lineNum" href="#1116">1116: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1117" class="source-line"><td><a class="source-lineNum" href="#1117">1117: </a></td><td></td></tr><tr id="1118" class="source-line"><td><a class="source-lineNum" href="#1118">1118: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="1119" class="source-line"><td><a class="source-lineNum" href="#1119">1119: </a></td><td></td></tr><tr id="1120" class="source-line"><td><a class="source-lineNum" href="#1120">1120: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1121" class="source-line"><td><a class="source-lineNum" href="#1121">1121: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1122" class="source-line"><td><a class="source-lineNum" href="#1122">1122: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1123" class="source-line"><td><a class="source-lineNum" href="#1123">1123: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1124" class="source-line"><td><a class="source-lineNum" href="#1124">1124: </a></td><td>		}</td></tr><tr id="1125" class="source-line"><td><a class="source-lineNum" href="#1125">1125: </a></td><td></td></tr><tr id="1126" class="source-line"><td><a class="source-lineNum" href="#1126">1126: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="1127" class="source-line"><td><a class="source-lineNum" href="#1127">1127: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="1128" class="source-line"><td><a class="source-lineNum" href="#1128">1128: </a></td><td>		}</td></tr><tr id="1129" class="source-line"><td><a class="source-lineNum" href="#1129">1129: </a></td><td></td></tr><tr id="1130" class="source-line"><td><a class="source-lineNum" href="#1130">1130: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1131" class="source-line"><td><a class="source-lineNum" href="#1131">1131: </a></td><td></td></tr><tr id="1132" class="source-line"><td><a class="source-lineNum" href="#1132">1132: </a></td><td>		<span class="php-var">$customer_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomer(<span class="php-var">$customer_id</span>);</td></tr><tr id="1133" class="source-line"><td><a class="source-lineNum" href="#1133">1133: </a></td><td></td></tr><tr id="1134" class="source-line"><td><a class="source-lineNum" href="#1134">1134: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$customer_info</span>) {</td></tr><tr id="1135" class="source-line"><td><a class="source-lineNum" href="#1135">1135: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_customer&#039;</span>);</td></tr><tr id="1136" class="source-line"><td><a class="source-lineNum" href="#1136">1136: </a></td><td>		}</td></tr><tr id="1137" class="source-line"><td><a class="source-lineNum" href="#1137">1137: </a></td><td></td></tr><tr id="1138" class="source-line"><td><a class="source-lineNum" href="#1138">1138: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="1139" class="source-line"><td><a class="source-lineNum" href="#1139">1139: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1140" class="source-line"><td><a class="source-lineNum" href="#1140">1140: </a></td><td></td></tr><tr id="1141" class="source-line"><td><a class="source-lineNum" href="#1141">1141: </a></td><td>			<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;addTransaction(<span class="php-var">$customer_id</span>, (string)<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;description&#039;</span>], (float)<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;amount&#039;</span>]);</td></tr><tr id="1142" class="source-line"><td><a class="source-lineNum" href="#1142">1142: </a></td><td></td></tr><tr id="1143" class="source-line"><td><a class="source-lineNum" href="#1143">1143: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="1144" class="source-line"><td><a class="source-lineNum" href="#1144">1144: </a></td><td>		}</td></tr><tr id="1145" class="source-line"><td><a class="source-lineNum" href="#1145">1145: </a></td><td></td></tr><tr id="1146" class="source-line"><td><a class="source-lineNum" href="#1146">1146: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="1147" class="source-line"><td><a class="source-lineNum" href="#1147">1147: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="1148" class="source-line"><td><a class="source-lineNum" href="#1148">1148: </a></td><td>	}</td></tr><tr id="1149" class="source-line"><td><a class="source-lineNum" href="#1149">1149: </a></td><td></td></tr><tr id="1150" class="source-line"><td><a class="source-lineNum" href="#1150">1150: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1151" class="source-line"><td><a class="source-lineNum" href="#1151">1151: </a></td><td><span class="php-comment">	 * Reward</span></td></tr><tr id="1152" class="source-line"><td><a class="source-lineNum" href="#1152">1152: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1153" class="source-line"><td><a class="source-lineNum" href="#1153">1153: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1154" class="source-line"><td><a class="source-lineNum" href="#1154">1154: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1155" class="source-line"><td><a class="source-lineNum" href="#1155">1155: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> reward(): void {</td></tr><tr id="1156" class="source-line"><td><a class="source-lineNum" href="#1156">1156: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1157" class="source-line"><td><a class="source-lineNum" href="#1157">1157: </a></td><td></td></tr><tr id="1158" class="source-line"><td><a class="source-lineNum" href="#1158">1158: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getReward());</td></tr><tr id="1159" class="source-line"><td><a class="source-lineNum" href="#1159">1159: </a></td><td>	}</td></tr><tr id="1160" class="source-line"><td><a class="source-lineNum" href="#1160">1160: </a></td><td></td></tr><tr id="1161" class="source-line"><td><a class="source-lineNum" href="#1161">1161: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1162" class="source-line"><td><a class="source-lineNum" href="#1162">1162: </a></td><td><span class="php-comment">	 * Get Reward</span></td></tr><tr id="1163" class="source-line"><td><a class="source-lineNum" href="#1163">1163: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1164" class="source-line"><td><a class="source-lineNum" href="#1164">1164: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="1165" class="source-line"><td><a class="source-lineNum" href="#1165">1165: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1166" class="source-line"><td><a class="source-lineNum" href="#1166">1166: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> getReward(): string {</td></tr><tr id="1167" class="source-line"><td><a class="source-lineNum" href="#1167">1167: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1168" class="source-line"><td><a class="source-lineNum" href="#1168">1168: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1169" class="source-line"><td><a class="source-lineNum" href="#1169">1169: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1170" class="source-line"><td><a class="source-lineNum" href="#1170">1170: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1171" class="source-line"><td><a class="source-lineNum" href="#1171">1171: </a></td><td>		}</td></tr><tr id="1172" class="source-line"><td><a class="source-lineNum" href="#1172">1172: </a></td><td></td></tr><tr id="1173" class="source-line"><td><a class="source-lineNum" href="#1173">1173: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>]) &amp;&amp; <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;route&#039;</span>] == <span class="php-str">&#039;customer/customer.reward&#039;</span>) {</td></tr><tr id="1174" class="source-line"><td><a class="source-lineNum" href="#1174">1174: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="1175" class="source-line"><td><a class="source-lineNum" href="#1175">1175: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1176" class="source-line"><td><a class="source-lineNum" href="#1176">1176: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="1177" class="source-line"><td><a class="source-lineNum" href="#1177">1177: </a></td><td>		}</td></tr><tr id="1178" class="source-line"><td><a class="source-lineNum" href="#1178">1178: </a></td><td></td></tr><tr id="1179" class="source-line"><td><a class="source-lineNum" href="#1179">1179: </a></td><td>		<span class="php-var">$limit</span> = <span class="php-num">10</span>;</td></tr><tr id="1180" class="source-line"><td><a class="source-lineNum" href="#1180">1180: </a></td><td></td></tr><tr id="1181" class="source-line"><td><a class="source-lineNum" href="#1181">1181: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;rewards&#039;</span>] = [];</td></tr><tr id="1182" class="source-line"><td><a class="source-lineNum" href="#1182">1182: </a></td><td></td></tr><tr id="1183" class="source-line"><td><a class="source-lineNum" href="#1183">1183: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1184" class="source-line"><td><a class="source-lineNum" href="#1184">1184: </a></td><td></td></tr><tr id="1185" class="source-line"><td><a class="source-lineNum" href="#1185">1185: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getRewards(<span class="php-var">$customer_id</span>, (<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>, <span class="php-var">$limit</span>);</td></tr><tr id="1186" class="source-line"><td><a class="source-lineNum" href="#1186">1186: </a></td><td></td></tr><tr id="1187" class="source-line"><td><a class="source-lineNum" href="#1187">1187: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="1188" class="source-line"><td><a class="source-lineNum" href="#1188">1188: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;rewards&#039;</span>][] = [</td></tr><tr id="1189" class="source-line"><td><a class="source-lineNum" href="#1189">1189: </a></td><td>				<span class="php-str">&#039;points&#039;</span>      =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;points&#039;</span>],</td></tr><tr id="1190" class="source-line"><td><a class="source-lineNum" href="#1190">1190: </a></td><td>				<span class="php-str">&#039;description&#039;</span> =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;description&#039;</span>],</td></tr><tr id="1191" class="source-line"><td><a class="source-lineNum" href="#1191">1191: </a></td><td>				<span class="php-str">&#039;date_added&#039;</span>  =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;date_format_short&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_added&#039;</span>]))</td></tr><tr id="1192" class="source-line"><td><a class="source-lineNum" href="#1192">1192: </a></td><td>			];</td></tr><tr id="1193" class="source-line"><td><a class="source-lineNum" href="#1193">1193: </a></td><td>		}</td></tr><tr id="1194" class="source-line"><td><a class="source-lineNum" href="#1194">1194: </a></td><td></td></tr><tr id="1195" class="source-line"><td><a class="source-lineNum" href="#1195">1195: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;balance&#039;</span>] = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getRewardTotal(<span class="php-var">$customer_id</span>);</td></tr><tr id="1196" class="source-line"><td><a class="source-lineNum" href="#1196">1196: </a></td><td></td></tr><tr id="1197" class="source-line"><td><a class="source-lineNum" href="#1197">1197: </a></td><td>		<span class="php-var">$reward_total</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalRewards(<span class="php-var">$customer_id</span>);</td></tr><tr id="1198" class="source-line"><td><a class="source-lineNum" href="#1198">1198: </a></td><td></td></tr><tr id="1199" class="source-line"><td><a class="source-lineNum" href="#1199">1199: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="1200" class="source-line"><td><a class="source-lineNum" href="#1200">1200: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$reward_total</span>,</td></tr><tr id="1201" class="source-line"><td><a class="source-lineNum" href="#1201">1201: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="1202" class="source-line"><td><a class="source-lineNum" href="#1202">1202: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$limit</span>,</td></tr><tr id="1203" class="source-line"><td><a class="source-lineNum" href="#1203">1203: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.reward&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$customer_id</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="1204" class="source-line"><td><a class="source-lineNum" href="#1204">1204: </a></td><td>		]);</td></tr><tr id="1205" class="source-line"><td><a class="source-lineNum" href="#1205">1205: </a></td><td></td></tr><tr id="1206" class="source-line"><td><a class="source-lineNum" href="#1206">1206: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$reward_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) &gt; (<span class="php-var">$reward_total</span> - <span class="php-var">$limit</span>)) ? <span class="php-var">$reward_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-var">$limit</span>), <span class="php-var">$reward_total</span>, ceil(<span class="php-var">$reward_total</span> / <span class="php-var">$limit</span>));</td></tr><tr id="1207" class="source-line"><td><a class="source-lineNum" href="#1207">1207: </a></td><td></td></tr><tr id="1208" class="source-line"><td><a class="source-lineNum" href="#1208">1208: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_reward&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="1209" class="source-line"><td><a class="source-lineNum" href="#1209">1209: </a></td><td>	}</td></tr><tr id="1210" class="source-line"><td><a class="source-lineNum" href="#1210">1210: </a></td><td></td></tr><tr id="1211" class="source-line"><td><a class="source-lineNum" href="#1211">1211: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1212" class="source-line"><td><a class="source-lineNum" href="#1212">1212: </a></td><td><span class="php-comment">	 * Add Reward</span></td></tr><tr id="1213" class="source-line"><td><a class="source-lineNum" href="#1213">1213: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1214" class="source-line"><td><a class="source-lineNum" href="#1214">1214: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1215" class="source-line"><td><a class="source-lineNum" href="#1215">1215: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1216" class="source-line"><td><a class="source-lineNum" href="#1216">1216: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> addReward(): void {</td></tr><tr id="1217" class="source-line"><td><a class="source-lineNum" href="#1217">1217: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1218" class="source-line"><td><a class="source-lineNum" href="#1218">1218: </a></td><td></td></tr><tr id="1219" class="source-line"><td><a class="source-lineNum" href="#1219">1219: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="1220" class="source-line"><td><a class="source-lineNum" href="#1220">1220: </a></td><td></td></tr><tr id="1221" class="source-line"><td><a class="source-lineNum" href="#1221">1221: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1222" class="source-line"><td><a class="source-lineNum" href="#1222">1222: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1223" class="source-line"><td><a class="source-lineNum" href="#1223">1223: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1224" class="source-line"><td><a class="source-lineNum" href="#1224">1224: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1225" class="source-line"><td><a class="source-lineNum" href="#1225">1225: </a></td><td>		}</td></tr><tr id="1226" class="source-line"><td><a class="source-lineNum" href="#1226">1226: </a></td><td></td></tr><tr id="1227" class="source-line"><td><a class="source-lineNum" href="#1227">1227: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="1228" class="source-line"><td><a class="source-lineNum" href="#1228">1228: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="1229" class="source-line"><td><a class="source-lineNum" href="#1229">1229: </a></td><td>		}</td></tr><tr id="1230" class="source-line"><td><a class="source-lineNum" href="#1230">1230: </a></td><td></td></tr><tr id="1231" class="source-line"><td><a class="source-lineNum" href="#1231">1231: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1232" class="source-line"><td><a class="source-lineNum" href="#1232">1232: </a></td><td></td></tr><tr id="1233" class="source-line"><td><a class="source-lineNum" href="#1233">1233: </a></td><td>		<span class="php-var">$customer_info</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomer(<span class="php-var">$customer_id</span>);</td></tr><tr id="1234" class="source-line"><td><a class="source-lineNum" href="#1234">1234: </a></td><td></td></tr><tr id="1235" class="source-line"><td><a class="source-lineNum" href="#1235">1235: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$customer_info</span>) {</td></tr><tr id="1236" class="source-line"><td><a class="source-lineNum" href="#1236">1236: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_customer&#039;</span>);</td></tr><tr id="1237" class="source-line"><td><a class="source-lineNum" href="#1237">1237: </a></td><td>		}</td></tr><tr id="1238" class="source-line"><td><a class="source-lineNum" href="#1238">1238: </a></td><td></td></tr><tr id="1239" class="source-line"><td><a class="source-lineNum" href="#1239">1239: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="1240" class="source-line"><td><a class="source-lineNum" href="#1240">1240: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1241" class="source-line"><td><a class="source-lineNum" href="#1241">1241: </a></td><td></td></tr><tr id="1242" class="source-line"><td><a class="source-lineNum" href="#1242">1242: </a></td><td>			<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;addReward(<span class="php-var">$customer_id</span>, (string)<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;description&#039;</span>], (int)<span class="php-var">$this</span>-&gt;request-&gt;post[<span class="php-str">&#039;points&#039;</span>]);</td></tr><tr id="1243" class="source-line"><td><a class="source-lineNum" href="#1243">1243: </a></td><td></td></tr><tr id="1244" class="source-line"><td><a class="source-lineNum" href="#1244">1244: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="1245" class="source-line"><td><a class="source-lineNum" href="#1245">1245: </a></td><td>		}</td></tr><tr id="1246" class="source-line"><td><a class="source-lineNum" href="#1246">1246: </a></td><td></td></tr><tr id="1247" class="source-line"><td><a class="source-lineNum" href="#1247">1247: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="1248" class="source-line"><td><a class="source-lineNum" href="#1248">1248: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="1249" class="source-line"><td><a class="source-lineNum" href="#1249">1249: </a></td><td>	}</td></tr><tr id="1250" class="source-line"><td><a class="source-lineNum" href="#1250">1250: </a></td><td></td></tr><tr id="1251" class="source-line"><td><a class="source-lineNum" href="#1251">1251: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1252" class="source-line"><td><a class="source-lineNum" href="#1252">1252: </a></td><td><span class="php-comment">	 * Ip</span></td></tr><tr id="1253" class="source-line"><td><a class="source-lineNum" href="#1253">1253: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1254" class="source-line"><td><a class="source-lineNum" href="#1254">1254: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1255" class="source-line"><td><a class="source-lineNum" href="#1255">1255: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1256" class="source-line"><td><a class="source-lineNum" href="#1256">1256: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> ip(): void {</td></tr><tr id="1257" class="source-line"><td><a class="source-lineNum" href="#1257">1257: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1258" class="source-line"><td><a class="source-lineNum" href="#1258">1258: </a></td><td></td></tr><tr id="1259" class="source-line"><td><a class="source-lineNum" href="#1259">1259: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getIp());</td></tr><tr id="1260" class="source-line"><td><a class="source-lineNum" href="#1260">1260: </a></td><td>	}</td></tr><tr id="1261" class="source-line"><td><a class="source-lineNum" href="#1261">1261: </a></td><td></td></tr><tr id="1262" class="source-line"><td><a class="source-lineNum" href="#1262">1262: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1263" class="source-line"><td><a class="source-lineNum" href="#1263">1263: </a></td><td><span class="php-comment">	 * Get Ip</span></td></tr><tr id="1264" class="source-line"><td><a class="source-lineNum" href="#1264">1264: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1265" class="source-line"><td><a class="source-lineNum" href="#1265">1265: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="1266" class="source-line"><td><a class="source-lineNum" href="#1266">1266: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1267" class="source-line"><td><a class="source-lineNum" href="#1267">1267: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> getIp(): string {</td></tr><tr id="1268" class="source-line"><td><a class="source-lineNum" href="#1268">1268: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1269" class="source-line"><td><a class="source-lineNum" href="#1269">1269: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1270" class="source-line"><td><a class="source-lineNum" href="#1270">1270: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1271" class="source-line"><td><a class="source-lineNum" href="#1271">1271: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1272" class="source-line"><td><a class="source-lineNum" href="#1272">1272: </a></td><td>		}</td></tr><tr id="1273" class="source-line"><td><a class="source-lineNum" href="#1273">1273: </a></td><td></td></tr><tr id="1274" class="source-line"><td><a class="source-lineNum" href="#1274">1274: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>]) &amp;&amp; <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;route&#039;</span>] == <span class="php-str">&#039;customer/customer.ip&#039;</span>) {</td></tr><tr id="1275" class="source-line"><td><a class="source-lineNum" href="#1275">1275: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="1276" class="source-line"><td><a class="source-lineNum" href="#1276">1276: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1277" class="source-line"><td><a class="source-lineNum" href="#1277">1277: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="1278" class="source-line"><td><a class="source-lineNum" href="#1278">1278: </a></td><td>		}</td></tr><tr id="1279" class="source-line"><td><a class="source-lineNum" href="#1279">1279: </a></td><td></td></tr><tr id="1280" class="source-line"><td><a class="source-lineNum" href="#1280">1280: </a></td><td>		<span class="php-var">$limit</span> = <span class="php-num">10</span>;</td></tr><tr id="1281" class="source-line"><td><a class="source-lineNum" href="#1281">1281: </a></td><td></td></tr><tr id="1282" class="source-line"><td><a class="source-lineNum" href="#1282">1282: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;ips&#039;</span>] = [];</td></tr><tr id="1283" class="source-line"><td><a class="source-lineNum" href="#1283">1283: </a></td><td></td></tr><tr id="1284" class="source-line"><td><a class="source-lineNum" href="#1284">1284: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1285" class="source-line"><td><a class="source-lineNum" href="#1285">1285: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;setting/store&#039;</span>);</td></tr><tr id="1286" class="source-line"><td><a class="source-lineNum" href="#1286">1286: </a></td><td></td></tr><tr id="1287" class="source-line"><td><a class="source-lineNum" href="#1287">1287: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getIps(<span class="php-var">$customer_id</span>, (<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>, <span class="php-var">$limit</span>);</td></tr><tr id="1288" class="source-line"><td><a class="source-lineNum" href="#1288">1288: </a></td><td></td></tr><tr id="1289" class="source-line"><td><a class="source-lineNum" href="#1289">1289: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="1290" class="source-line"><td><a class="source-lineNum" href="#1290">1290: </a></td><td>			<span class="php-var">$store_info</span> = <span class="php-var">$this</span>-&gt;model_setting_store-&gt;getStore(<span class="php-var">$result</span>[<span class="php-str">&#039;store_id&#039;</span>]);</td></tr><tr id="1291" class="source-line"><td><a class="source-lineNum" href="#1291">1291: </a></td><td></td></tr><tr id="1292" class="source-line"><td><a class="source-lineNum" href="#1292">1292: </a></td><td>			<span class="php-kw">if</span> (<span class="php-var">$store_info</span>) {</td></tr><tr id="1293" class="source-line"><td><a class="source-lineNum" href="#1293">1293: </a></td><td>				<span class="php-var">$store</span> = <span class="php-var">$store_info</span>[<span class="php-str">&#039;name&#039;</span>];</td></tr><tr id="1294" class="source-line"><td><a class="source-lineNum" href="#1294">1294: </a></td><td>			} <span class="php-kw">elseif</span> (!<span class="php-var">$result</span>[<span class="php-str">&#039;store_id&#039;</span>]) {</td></tr><tr id="1295" class="source-line"><td><a class="source-lineNum" href="#1295">1295: </a></td><td>				<span class="php-var">$store</span> = <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_name&#039;</span>);</td></tr><tr id="1296" class="source-line"><td><a class="source-lineNum" href="#1296">1296: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="1297" class="source-line"><td><a class="source-lineNum" href="#1297">1297: </a></td><td>				<span class="php-var">$store</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="1298" class="source-line"><td><a class="source-lineNum" href="#1298">1298: </a></td><td>			}</td></tr><tr id="1299" class="source-line"><td><a class="source-lineNum" href="#1299">1299: </a></td><td></td></tr><tr id="1300" class="source-line"><td><a class="source-lineNum" href="#1300">1300: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;ips&#039;</span>][] = [</td></tr><tr id="1301" class="source-line"><td><a class="source-lineNum" href="#1301">1301: </a></td><td>				<span class="php-str">&#039;ip&#039;</span>         =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;ip&#039;</span>],</td></tr><tr id="1302" class="source-line"><td><a class="source-lineNum" href="#1302">1302: </a></td><td>				<span class="php-str">&#039;account&#039;</span>    =&gt; <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalCustomersByIp(<span class="php-var">$result</span>[<span class="php-str">&#039;ip&#039;</span>]),</td></tr><tr id="1303" class="source-line"><td><a class="source-lineNum" href="#1303">1303: </a></td><td>				<span class="php-str">&#039;store&#039;</span>      =&gt; <span class="php-var">$store</span>,</td></tr><tr id="1304" class="source-line"><td><a class="source-lineNum" href="#1304">1304: </a></td><td>				<span class="php-str">&#039;country&#039;</span>    =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;country&#039;</span>],</td></tr><tr id="1305" class="source-line"><td><a class="source-lineNum" href="#1305">1305: </a></td><td>				<span class="php-str">&#039;date_added&#039;</span> =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;datetime_format&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_added&#039;</span>])),</td></tr><tr id="1306" class="source-line"><td><a class="source-lineNum" href="#1306">1306: </a></td><td>				<span class="php-str">&#039;filter_ip&#039;</span>  =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;filter_ip=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;ip&#039;</span>])</td></tr><tr id="1307" class="source-line"><td><a class="source-lineNum" href="#1307">1307: </a></td><td>			];</td></tr><tr id="1308" class="source-line"><td><a class="source-lineNum" href="#1308">1308: </a></td><td>		}</td></tr><tr id="1309" class="source-line"><td><a class="source-lineNum" href="#1309">1309: </a></td><td></td></tr><tr id="1310" class="source-line"><td><a class="source-lineNum" href="#1310">1310: </a></td><td>		<span class="php-var">$ip_total</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalIps(<span class="php-var">$customer_id</span>);</td></tr><tr id="1311" class="source-line"><td><a class="source-lineNum" href="#1311">1311: </a></td><td></td></tr><tr id="1312" class="source-line"><td><a class="source-lineNum" href="#1312">1312: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="1313" class="source-line"><td><a class="source-lineNum" href="#1313">1313: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$ip_total</span>,</td></tr><tr id="1314" class="source-line"><td><a class="source-lineNum" href="#1314">1314: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="1315" class="source-line"><td><a class="source-lineNum" href="#1315">1315: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$limit</span>,</td></tr><tr id="1316" class="source-line"><td><a class="source-lineNum" href="#1316">1316: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.ip&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$customer_id</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="1317" class="source-line"><td><a class="source-lineNum" href="#1317">1317: </a></td><td>		]);</td></tr><tr id="1318" class="source-line"><td><a class="source-lineNum" href="#1318">1318: </a></td><td></td></tr><tr id="1319" class="source-line"><td><a class="source-lineNum" href="#1319">1319: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$ip_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) &gt; (<span class="php-var">$ip_total</span> - <span class="php-var">$limit</span>)) ? <span class="php-var">$ip_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-var">$limit</span>), <span class="php-var">$ip_total</span>, ceil(<span class="php-var">$ip_total</span> / <span class="php-var">$limit</span>));</td></tr><tr id="1320" class="source-line"><td><a class="source-lineNum" href="#1320">1320: </a></td><td></td></tr><tr id="1321" class="source-line"><td><a class="source-lineNum" href="#1321">1321: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_ip&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="1322" class="source-line"><td><a class="source-lineNum" href="#1322">1322: </a></td><td>	}</td></tr><tr id="1323" class="source-line"><td><a class="source-lineNum" href="#1323">1323: </a></td><td></td></tr><tr id="1324" class="source-line"><td><a class="source-lineNum" href="#1324">1324: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1325" class="source-line"><td><a class="source-lineNum" href="#1325">1325: </a></td><td><span class="php-comment">	 * Authorize</span></td></tr><tr id="1326" class="source-line"><td><a class="source-lineNum" href="#1326">1326: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1327" class="source-line"><td><a class="source-lineNum" href="#1327">1327: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1328" class="source-line"><td><a class="source-lineNum" href="#1328">1328: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1329" class="source-line"><td><a class="source-lineNum" href="#1329">1329: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> authorize(): void {</td></tr><tr id="1330" class="source-line"><td><a class="source-lineNum" href="#1330">1330: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1331" class="source-line"><td><a class="source-lineNum" href="#1331">1331: </a></td><td></td></tr><tr id="1332" class="source-line"><td><a class="source-lineNum" href="#1332">1332: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(<span class="php-var">$this</span>-&gt;getAuthorize());</td></tr><tr id="1333" class="source-line"><td><a class="source-lineNum" href="#1333">1333: </a></td><td>	}</td></tr><tr id="1334" class="source-line"><td><a class="source-lineNum" href="#1334">1334: </a></td><td></td></tr><tr id="1335" class="source-line"><td><a class="source-lineNum" href="#1335">1335: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1336" class="source-line"><td><a class="source-lineNum" href="#1336">1336: </a></td><td><span class="php-comment">	 * Get Authorize</span></td></tr><tr id="1337" class="source-line"><td><a class="source-lineNum" href="#1337">1337: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1338" class="source-line"><td><a class="source-lineNum" href="#1338">1338: </a></td><td><span class="php-comment">	 * @return string</span></td></tr><tr id="1339" class="source-line"><td><a class="source-lineNum" href="#1339">1339: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1340" class="source-line"><td><a class="source-lineNum" href="#1340">1340: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> getAuthorize(): string {</td></tr><tr id="1341" class="source-line"><td><a class="source-lineNum" href="#1341">1341: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>])) {</td></tr><tr id="1342" class="source-line"><td><a class="source-lineNum" href="#1342">1342: </a></td><td>			<span class="php-var">$customer_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_id&#039;</span>];</td></tr><tr id="1343" class="source-line"><td><a class="source-lineNum" href="#1343">1343: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1344" class="source-line"><td><a class="source-lineNum" href="#1344">1344: </a></td><td>			<span class="php-var">$customer_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1345" class="source-line"><td><a class="source-lineNum" href="#1345">1345: </a></td><td>		}</td></tr><tr id="1346" class="source-line"><td><a class="source-lineNum" href="#1346">1346: </a></td><td></td></tr><tr id="1347" class="source-line"><td><a class="source-lineNum" href="#1347">1347: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>]) &amp;&amp; <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;route&#039;</span>] == <span class="php-str">&#039;customer/customer.login&#039;</span>) {</td></tr><tr id="1348" class="source-line"><td><a class="source-lineNum" href="#1348">1348: </a></td><td>			<span class="php-var">$page</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;page&#039;</span>];</td></tr><tr id="1349" class="source-line"><td><a class="source-lineNum" href="#1349">1349: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1350" class="source-line"><td><a class="source-lineNum" href="#1350">1350: </a></td><td>			<span class="php-var">$page</span> = <span class="php-num">1</span>;</td></tr><tr id="1351" class="source-line"><td><a class="source-lineNum" href="#1351">1351: </a></td><td>		}</td></tr><tr id="1352" class="source-line"><td><a class="source-lineNum" href="#1352">1352: </a></td><td></td></tr><tr id="1353" class="source-line"><td><a class="source-lineNum" href="#1353">1353: </a></td><td>		<span class="php-var">$limit</span> = <span class="php-num">10</span>;</td></tr><tr id="1354" class="source-line"><td><a class="source-lineNum" href="#1354">1354: </a></td><td></td></tr><tr id="1355" class="source-line"><td><a class="source-lineNum" href="#1355">1355: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;authorizes&#039;</span>] = [];</td></tr><tr id="1356" class="source-line"><td><a class="source-lineNum" href="#1356">1356: </a></td><td></td></tr><tr id="1357" class="source-line"><td><a class="source-lineNum" href="#1357">1357: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1358" class="source-line"><td><a class="source-lineNum" href="#1358">1358: </a></td><td></td></tr><tr id="1359" class="source-line"><td><a class="source-lineNum" href="#1359">1359: </a></td><td>		<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getAuthorizes(<span class="php-var">$customer_id</span>, (<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>, <span class="php-var">$limit</span>);</td></tr><tr id="1360" class="source-line"><td><a class="source-lineNum" href="#1360">1360: </a></td><td></td></tr><tr id="1361" class="source-line"><td><a class="source-lineNum" href="#1361">1361: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="1362" class="source-line"><td><a class="source-lineNum" href="#1362">1362: </a></td><td>			<span class="php-var">$data</span>[<span class="php-str">&#039;authorizes&#039;</span>][] = [</td></tr><tr id="1363" class="source-line"><td><a class="source-lineNum" href="#1363">1363: </a></td><td>				<span class="php-str">&#039;token&#039;</span>      =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;token&#039;</span>],</td></tr><tr id="1364" class="source-line"><td><a class="source-lineNum" href="#1364">1364: </a></td><td>				<span class="php-str">&#039;ip&#039;</span>         =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;ip&#039;</span>],</td></tr><tr id="1365" class="source-line"><td><a class="source-lineNum" href="#1365">1365: </a></td><td>				<span class="php-str">&#039;user_agent&#039;</span> =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;user_agent&#039;</span>],</td></tr><tr id="1366" class="source-line"><td><a class="source-lineNum" href="#1366">1366: </a></td><td>				<span class="php-str">&#039;status&#039;</span>     =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;status&#039;</span>] ? <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_enabled&#039;</span>) : <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_disabled&#039;</span>),</td></tr><tr id="1367" class="source-line"><td><a class="source-lineNum" href="#1367">1367: </a></td><td>				<span class="php-str">&#039;total&#039;</span>      =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;total&#039;</span>],</td></tr><tr id="1368" class="source-line"><td><a class="source-lineNum" href="#1368">1368: </a></td><td>				<span class="php-str">&#039;date_added&#039;</span> =&gt; date(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;datetime_format&#039;</span>), strtotime(<span class="php-var">$result</span>[<span class="php-str">&#039;date_added&#039;</span>])),</td></tr><tr id="1369" class="source-line"><td><a class="source-lineNum" href="#1369">1369: </a></td><td>				<span class="php-str">&#039;delete&#039;</span>     =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.deleteAuthorize&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;user_authorize_id=&#039;</span> . <span class="php-var">$result</span>[<span class="php-str">&#039;user_authorize_id&#039;</span>])</td></tr><tr id="1370" class="source-line"><td><a class="source-lineNum" href="#1370">1370: </a></td><td>			];</td></tr><tr id="1371" class="source-line"><td><a class="source-lineNum" href="#1371">1371: </a></td><td>		}</td></tr><tr id="1372" class="source-line"><td><a class="source-lineNum" href="#1372">1372: </a></td><td></td></tr><tr id="1373" class="source-line"><td><a class="source-lineNum" href="#1373">1373: </a></td><td>		<span class="php-var">$authorize_total</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getTotalAuthorizes(<span class="php-var">$customer_id</span>);</td></tr><tr id="1374" class="source-line"><td><a class="source-lineNum" href="#1374">1374: </a></td><td></td></tr><tr id="1375" class="source-line"><td><a class="source-lineNum" href="#1375">1375: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;pagination&#039;</span>] = <span class="php-var">$this</span>-&gt;load-&gt;controller(<span class="php-str">&#039;common/pagination&#039;</span>, [</td></tr><tr id="1376" class="source-line"><td><a class="source-lineNum" href="#1376">1376: </a></td><td>			<span class="php-str">&#039;total&#039;</span> =&gt; <span class="php-var">$authorize_total</span>,</td></tr><tr id="1377" class="source-line"><td><a class="source-lineNum" href="#1377">1377: </a></td><td>			<span class="php-str">&#039;page&#039;</span>  =&gt; <span class="php-var">$page</span>,</td></tr><tr id="1378" class="source-line"><td><a class="source-lineNum" href="#1378">1378: </a></td><td>			<span class="php-str">&#039;limit&#039;</span> =&gt; <span class="php-var">$limit</span>,</td></tr><tr id="1379" class="source-line"><td><a class="source-lineNum" href="#1379">1379: </a></td><td>			<span class="php-str">&#039;url&#039;</span>   =&gt; <span class="php-var">$this</span>-&gt;url-&gt;link(<span class="php-str">&#039;customer/customer.authorize&#039;</span>, <span class="php-str">&#039;user_token=&#039;</span> . <span class="php-var">$this</span>-&gt;session-&gt;data[<span class="php-str">&#039;user_token&#039;</span>] . <span class="php-str">&#039;&amp;customer_id=&#039;</span> . <span class="php-var">$customer_id</span> . <span class="php-str">&#039;&amp;page={page}&#039;</span>)</td></tr><tr id="1380" class="source-line"><td><a class="source-lineNum" href="#1380">1380: </a></td><td>		]);</td></tr><tr id="1381" class="source-line"><td><a class="source-lineNum" href="#1381">1381: </a></td><td></td></tr><tr id="1382" class="source-line"><td><a class="source-lineNum" href="#1382">1382: </a></td><td>		<span class="php-var">$data</span>[<span class="php-str">&#039;results&#039;</span>] = sprintf(<span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_pagination&#039;</span>), (<span class="php-var">$authorize_total</span>) ? ((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-num">1</span> : <span class="php-num">0</span>, (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) &gt; (<span class="php-var">$authorize_total</span> - <span class="php-var">$limit</span>)) ? <span class="php-var">$authorize_total</span> : (((<span class="php-var">$page</span> - <span class="php-num">1</span>) * <span class="php-var">$limit</span>) + <span class="php-var">$limit</span>), <span class="php-var">$authorize_total</span>, ceil(<span class="php-var">$authorize_total</span> / <span class="php-var">$limit</span>));</td></tr><tr id="1383" class="source-line"><td><a class="source-lineNum" href="#1383">1383: </a></td><td></td></tr><tr id="1384" class="source-line"><td><a class="source-lineNum" href="#1384">1384: </a></td><td>		<span class="php-kw">return</span> <span class="php-var">$this</span>-&gt;load-&gt;view(<span class="php-str">&#039;customer/customer_authorize&#039;</span>, <span class="php-var">$data</span>);</td></tr><tr id="1385" class="source-line"><td><a class="source-lineNum" href="#1385">1385: </a></td><td>	}</td></tr><tr id="1386" class="source-line"><td><a class="source-lineNum" href="#1386">1386: </a></td><td></td></tr><tr id="1387" class="source-line"><td><a class="source-lineNum" href="#1387">1387: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1388" class="source-line"><td><a class="source-lineNum" href="#1388">1388: </a></td><td><span class="php-comment">	 * Delete Authorize</span></td></tr><tr id="1389" class="source-line"><td><a class="source-lineNum" href="#1389">1389: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1390" class="source-line"><td><a class="source-lineNum" href="#1390">1390: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1391" class="source-line"><td><a class="source-lineNum" href="#1391">1391: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1392" class="source-line"><td><a class="source-lineNum" href="#1392">1392: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> deleteAuthorize(): void {</td></tr><tr id="1393" class="source-line"><td><a class="source-lineNum" href="#1393">1393: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;language(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1394" class="source-line"><td><a class="source-lineNum" href="#1394">1394: </a></td><td></td></tr><tr id="1395" class="source-line"><td><a class="source-lineNum" href="#1395">1395: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="1396" class="source-line"><td><a class="source-lineNum" href="#1396">1396: </a></td><td></td></tr><tr id="1397" class="source-line"><td><a class="source-lineNum" href="#1397">1397: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_authorize_id&#039;</span>])) {</td></tr><tr id="1398" class="source-line"><td><a class="source-lineNum" href="#1398">1398: </a></td><td>			<span class="php-var">$customer_authorize_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_authorize_id&#039;</span>];</td></tr><tr id="1399" class="source-line"><td><a class="source-lineNum" href="#1399">1399: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1400" class="source-line"><td><a class="source-lineNum" href="#1400">1400: </a></td><td>			<span class="php-var">$customer_authorize_id</span> = <span class="php-num">0</span>;</td></tr><tr id="1401" class="source-line"><td><a class="source-lineNum" href="#1401">1401: </a></td><td>		}</td></tr><tr id="1402" class="source-line"><td><a class="source-lineNum" href="#1402">1402: </a></td><td></td></tr><tr id="1403" class="source-line"><td><a class="source-lineNum" href="#1403">1403: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;cookie[<span class="php-str">&#039;authorize&#039;</span>])) {</td></tr><tr id="1404" class="source-line"><td><a class="source-lineNum" href="#1404">1404: </a></td><td>			<span class="php-var">$token</span> = <span class="php-var">$this</span>-&gt;request-&gt;cookie[<span class="php-str">&#039;authorize&#039;</span>];</td></tr><tr id="1405" class="source-line"><td><a class="source-lineNum" href="#1405">1405: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1406" class="source-line"><td><a class="source-lineNum" href="#1406">1406: </a></td><td>			<span class="php-var">$token</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="1407" class="source-line"><td><a class="source-lineNum" href="#1407">1407: </a></td><td>		}</td></tr><tr id="1408" class="source-line"><td><a class="source-lineNum" href="#1408">1408: </a></td><td></td></tr><tr id="1409" class="source-line"><td><a class="source-lineNum" href="#1409">1409: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$this</span>-&gt;user-&gt;hasPermission(<span class="php-str">&#039;modify&#039;</span>, <span class="php-str">&#039;customer/customer&#039;</span>)) {</td></tr><tr id="1410" class="source-line"><td><a class="source-lineNum" href="#1410">1410: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_permission&#039;</span>);</td></tr><tr id="1411" class="source-line"><td><a class="source-lineNum" href="#1411">1411: </a></td><td>		}</td></tr><tr id="1412" class="source-line"><td><a class="source-lineNum" href="#1412">1412: </a></td><td></td></tr><tr id="1413" class="source-line"><td><a class="source-lineNum" href="#1413">1413: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;user/user&#039;</span>);</td></tr><tr id="1414" class="source-line"><td><a class="source-lineNum" href="#1414">1414: </a></td><td></td></tr><tr id="1415" class="source-line"><td><a class="source-lineNum" href="#1415">1415: </a></td><td>		<span class="php-var">$authorize_info</span> = <span class="php-var">$this</span>-&gt;model_user_user-&gt;getAuthorize(<span class="php-var">$customer_authorize_id</span>);</td></tr><tr id="1416" class="source-line"><td><a class="source-lineNum" href="#1416">1416: </a></td><td></td></tr><tr id="1417" class="source-line"><td><a class="source-lineNum" href="#1417">1417: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$authorize_info</span>) {</td></tr><tr id="1418" class="source-line"><td><a class="source-lineNum" href="#1418">1418: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;error&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;error_authorize&#039;</span>);</td></tr><tr id="1419" class="source-line"><td><a class="source-lineNum" href="#1419">1419: </a></td><td>		}</td></tr><tr id="1420" class="source-line"><td><a class="source-lineNum" href="#1420">1420: </a></td><td></td></tr><tr id="1421" class="source-line"><td><a class="source-lineNum" href="#1421">1421: </a></td><td>		<span class="php-kw">if</span> (!<span class="php-var">$json</span>) {</td></tr><tr id="1422" class="source-line"><td><a class="source-lineNum" href="#1422">1422: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1423" class="source-line"><td><a class="source-lineNum" href="#1423">1423: </a></td><td></td></tr><tr id="1424" class="source-line"><td><a class="source-lineNum" href="#1424">1424: </a></td><td>			<span class="php-var">$this</span>-&gt;model_customer_customer-&gt;deleteAuthorizes(<span class="php-var">$authorize_info</span>[<span class="php-str">&#039;customer_id&#039;</span>], <span class="php-var">$customer_authorize_id</span>);</td></tr><tr id="1425" class="source-line"><td><a class="source-lineNum" href="#1425">1425: </a></td><td></td></tr><tr id="1426" class="source-line"><td><a class="source-lineNum" href="#1426">1426: </a></td><td>			<span class="php-var">$json</span>[<span class="php-str">&#039;success&#039;</span>] = <span class="php-var">$this</span>-&gt;language-&gt;get(<span class="php-str">&#039;text_success&#039;</span>);</td></tr><tr id="1427" class="source-line"><td><a class="source-lineNum" href="#1427">1427: </a></td><td>		}</td></tr><tr id="1428" class="source-line"><td><a class="source-lineNum" href="#1428">1428: </a></td><td></td></tr><tr id="1429" class="source-line"><td><a class="source-lineNum" href="#1429">1429: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="1430" class="source-line"><td><a class="source-lineNum" href="#1430">1430: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="1431" class="source-line"><td><a class="source-lineNum" href="#1431">1431: </a></td><td>	}</td></tr><tr id="1432" class="source-line"><td><a class="source-lineNum" href="#1432">1432: </a></td><td></td></tr><tr id="1433" class="source-line"><td><a class="source-lineNum" href="#1433">1433: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1434" class="source-line"><td><a class="source-lineNum" href="#1434">1434: </a></td><td><span class="php-comment">	 * Autocomplete</span></td></tr><tr id="1435" class="source-line"><td><a class="source-lineNum" href="#1435">1435: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1436" class="source-line"><td><a class="source-lineNum" href="#1436">1436: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1437" class="source-line"><td><a class="source-lineNum" href="#1437">1437: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1438" class="source-line"><td><a class="source-lineNum" href="#1438">1438: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> autocomplete(): void {</td></tr><tr id="1439" class="source-line"><td><a class="source-lineNum" href="#1439">1439: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="1440" class="source-line"><td><a class="source-lineNum" href="#1440">1440: </a></td><td></td></tr><tr id="1441" class="source-line"><td><a class="source-lineNum" href="#1441">1441: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>]) || <span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="1442" class="source-line"><td><a class="source-lineNum" href="#1442">1442: </a></td><td>			<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>])) {</td></tr><tr id="1443" class="source-line"><td><a class="source-lineNum" href="#1443">1443: </a></td><td>				<span class="php-var">$filter_name</span> = <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_name&#039;</span>];</td></tr><tr id="1444" class="source-line"><td><a class="source-lineNum" href="#1444">1444: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="1445" class="source-line"><td><a class="source-lineNum" href="#1445">1445: </a></td><td>				<span class="php-var">$filter_name</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="1446" class="source-line"><td><a class="source-lineNum" href="#1446">1446: </a></td><td>			}</td></tr><tr id="1447" class="source-line"><td><a class="source-lineNum" href="#1447">1447: </a></td><td></td></tr><tr id="1448" class="source-line"><td><a class="source-lineNum" href="#1448">1448: </a></td><td>			<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>])) {</td></tr><tr id="1449" class="source-line"><td><a class="source-lineNum" href="#1449">1449: </a></td><td>				<span class="php-var">$filter_email</span> = <span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;filter_email&#039;</span>];</td></tr><tr id="1450" class="source-line"><td><a class="source-lineNum" href="#1450">1450: </a></td><td>			} <span class="php-kw">else</span> {</td></tr><tr id="1451" class="source-line"><td><a class="source-lineNum" href="#1451">1451: </a></td><td>				<span class="php-var">$filter_email</span> = <span class="php-str">&#039;&#039;</span>;</td></tr><tr id="1452" class="source-line"><td><a class="source-lineNum" href="#1452">1452: </a></td><td>			}</td></tr><tr id="1453" class="source-line"><td><a class="source-lineNum" href="#1453">1453: </a></td><td></td></tr><tr id="1454" class="source-line"><td><a class="source-lineNum" href="#1454">1454: </a></td><td>			<span class="php-var">$filter_data</span> = [</td></tr><tr id="1455" class="source-line"><td><a class="source-lineNum" href="#1455">1455: </a></td><td>				<span class="php-str">&#039;filter_name&#039;</span>  =&gt; <span class="php-var">$filter_name</span>,</td></tr><tr id="1456" class="source-line"><td><a class="source-lineNum" href="#1456">1456: </a></td><td>				<span class="php-str">&#039;filter_email&#039;</span> =&gt; <span class="php-var">$filter_email</span>,</td></tr><tr id="1457" class="source-line"><td><a class="source-lineNum" href="#1457">1457: </a></td><td>				<span class="php-str">&#039;start&#039;</span>        =&gt; <span class="php-num">0</span>,</td></tr><tr id="1458" class="source-line"><td><a class="source-lineNum" href="#1458">1458: </a></td><td>				<span class="php-str">&#039;limit&#039;</span>        =&gt; <span class="php-num">5</span></td></tr><tr id="1459" class="source-line"><td><a class="source-lineNum" href="#1459">1459: </a></td><td>			];</td></tr><tr id="1460" class="source-line"><td><a class="source-lineNum" href="#1460">1460: </a></td><td></td></tr><tr id="1461" class="source-line"><td><a class="source-lineNum" href="#1461">1461: </a></td><td>			<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/customer&#039;</span>);</td></tr><tr id="1462" class="source-line"><td><a class="source-lineNum" href="#1462">1462: </a></td><td></td></tr><tr id="1463" class="source-line"><td><a class="source-lineNum" href="#1463">1463: </a></td><td>			<span class="php-var">$results</span> = <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getCustomers(<span class="php-var">$filter_data</span>);</td></tr><tr id="1464" class="source-line"><td><a class="source-lineNum" href="#1464">1464: </a></td><td></td></tr><tr id="1465" class="source-line"><td><a class="source-lineNum" href="#1465">1465: </a></td><td>			<span class="php-kw">foreach</span> (<span class="php-var">$results</span> <span class="php-kw">as</span> <span class="php-var">$result</span>) {</td></tr><tr id="1466" class="source-line"><td><a class="source-lineNum" href="#1466">1466: </a></td><td>				<span class="php-var">$json</span>[] = [</td></tr><tr id="1467" class="source-line"><td><a class="source-lineNum" href="#1467">1467: </a></td><td>					<span class="php-str">&#039;customer_id&#039;</span>       =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;customer_id&#039;</span>],</td></tr><tr id="1468" class="source-line"><td><a class="source-lineNum" href="#1468">1468: </a></td><td>					<span class="php-str">&#039;customer_group_id&#039;</span> =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;customer_group_id&#039;</span>],</td></tr><tr id="1469" class="source-line"><td><a class="source-lineNum" href="#1469">1469: </a></td><td>					<span class="php-str">&#039;name&#039;</span>              =&gt; strip_tags(html_entity_decode(<span class="php-var">$result</span>[<span class="php-str">&#039;name&#039;</span>], ENT_QUOTES, <span class="php-str">&#039;UTF-8&#039;</span>)),</td></tr><tr id="1470" class="source-line"><td><a class="source-lineNum" href="#1470">1470: </a></td><td>					<span class="php-str">&#039;customer_group&#039;</span>    =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;customer_group&#039;</span>],</td></tr><tr id="1471" class="source-line"><td><a class="source-lineNum" href="#1471">1471: </a></td><td>					<span class="php-str">&#039;firstname&#039;</span>         =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;firstname&#039;</span>],</td></tr><tr id="1472" class="source-line"><td><a class="source-lineNum" href="#1472">1472: </a></td><td>					<span class="php-str">&#039;lastname&#039;</span>          =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;lastname&#039;</span>],</td></tr><tr id="1473" class="source-line"><td><a class="source-lineNum" href="#1473">1473: </a></td><td>					<span class="php-str">&#039;email&#039;</span>             =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;email&#039;</span>],</td></tr><tr id="1474" class="source-line"><td><a class="source-lineNum" href="#1474">1474: </a></td><td>					<span class="php-str">&#039;telephone&#039;</span>         =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;telephone&#039;</span>],</td></tr><tr id="1475" class="source-line"><td><a class="source-lineNum" href="#1475">1475: </a></td><td>					<span class="php-str">&#039;custom_field&#039;</span>      =&gt; <span class="php-var">$result</span>[<span class="php-str">&#039;custom_field&#039;</span>],</td></tr><tr id="1476" class="source-line"><td><a class="source-lineNum" href="#1476">1476: </a></td><td>					<span class="php-str">&#039;address&#039;</span>           =&gt; <span class="php-var">$this</span>-&gt;model_customer_customer-&gt;getAddresses(<span class="php-var">$result</span>[<span class="php-str">&#039;customer_id&#039;</span>])</td></tr><tr id="1477" class="source-line"><td><a class="source-lineNum" href="#1477">1477: </a></td><td>				];</td></tr><tr id="1478" class="source-line"><td><a class="source-lineNum" href="#1478">1478: </a></td><td>			}</td></tr><tr id="1479" class="source-line"><td><a class="source-lineNum" href="#1479">1479: </a></td><td>		}</td></tr><tr id="1480" class="source-line"><td><a class="source-lineNum" href="#1480">1480: </a></td><td></td></tr><tr id="1481" class="source-line"><td><a class="source-lineNum" href="#1481">1481: </a></td><td>		<span class="php-var">$sort_order</span> = [];</td></tr><tr id="1482" class="source-line"><td><a class="source-lineNum" href="#1482">1482: </a></td><td></td></tr><tr id="1483" class="source-line"><td><a class="source-lineNum" href="#1483">1483: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$json</span> <span class="php-kw">as</span> <span class="php-var">$key</span> =&gt; <span class="php-var">$value</span>) {</td></tr><tr id="1484" class="source-line"><td><a class="source-lineNum" href="#1484">1484: </a></td><td>			<span class="php-var">$sort_order</span>[<span class="php-var">$key</span>] = <span class="php-var">$value</span>[<span class="php-str">&#039;name&#039;</span>];</td></tr><tr id="1485" class="source-line"><td><a class="source-lineNum" href="#1485">1485: </a></td><td>		}</td></tr><tr id="1486" class="source-line"><td><a class="source-lineNum" href="#1486">1486: </a></td><td></td></tr><tr id="1487" class="source-line"><td><a class="source-lineNum" href="#1487">1487: </a></td><td>		array_multisort(<span class="php-var">$sort_order</span>, SORT_ASC, <span class="php-var">$json</span>);</td></tr><tr id="1488" class="source-line"><td><a class="source-lineNum" href="#1488">1488: </a></td><td></td></tr><tr id="1489" class="source-line"><td><a class="source-lineNum" href="#1489">1489: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="1490" class="source-line"><td><a class="source-lineNum" href="#1490">1490: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="1491" class="source-line"><td><a class="source-lineNum" href="#1491">1491: </a></td><td>	}</td></tr><tr id="1492" class="source-line"><td><a class="source-lineNum" href="#1492">1492: </a></td><td></td></tr><tr id="1493" class="source-line"><td><a class="source-lineNum" href="#1493">1493: </a></td><td>	<span class="php-comment">/**</span></td></tr><tr id="1494" class="source-line"><td><a class="source-lineNum" href="#1494">1494: </a></td><td><span class="php-comment">	 * Customfield</span></td></tr><tr id="1495" class="source-line"><td><a class="source-lineNum" href="#1495">1495: </a></td><td><span class="php-comment">	 *</span></td></tr><tr id="1496" class="source-line"><td><a class="source-lineNum" href="#1496">1496: </a></td><td><span class="php-comment">	 * @return void</span></td></tr><tr id="1497" class="source-line"><td><a class="source-lineNum" href="#1497">1497: </a></td><td><span class="php-comment">	 */</span></td></tr><tr id="1498" class="source-line"><td><a class="source-lineNum" href="#1498">1498: </a></td><td>	<span class="php-kw">public</span> <span class="php-kw">function</span> customfield(): void {</td></tr><tr id="1499" class="source-line"><td><a class="source-lineNum" href="#1499">1499: </a></td><td>		<span class="php-var">$json</span> = [];</td></tr><tr id="1500" class="source-line"><td><a class="source-lineNum" href="#1500">1500: </a></td><td></td></tr><tr id="1501" class="source-line"><td><a class="source-lineNum" href="#1501">1501: </a></td><td>		<span class="php-comment">// Customer Group</span></td></tr><tr id="1502" class="source-line"><td><a class="source-lineNum" href="#1502">1502: </a></td><td>		<span class="php-kw">if</span> (<span class="php-kw">isset</span>(<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_group_id&#039;</span>])) {</td></tr><tr id="1503" class="source-line"><td><a class="source-lineNum" href="#1503">1503: </a></td><td>			<span class="php-var">$customer_group_id</span> = (int)<span class="php-var">$this</span>-&gt;request-&gt;get[<span class="php-str">&#039;customer_group_id&#039;</span>];</td></tr><tr id="1504" class="source-line"><td><a class="source-lineNum" href="#1504">1504: </a></td><td>		} <span class="php-kw">else</span> {</td></tr><tr id="1505" class="source-line"><td><a class="source-lineNum" href="#1505">1505: </a></td><td>			<span class="php-var">$customer_group_id</span> = <span class="php-var">$this</span>-&gt;config-&gt;get(<span class="php-str">&#039;config_customer_group_id&#039;</span>);</td></tr><tr id="1506" class="source-line"><td><a class="source-lineNum" href="#1506">1506: </a></td><td>		}</td></tr><tr id="1507" class="source-line"><td><a class="source-lineNum" href="#1507">1507: </a></td><td></td></tr><tr id="1508" class="source-line"><td><a class="source-lineNum" href="#1508">1508: </a></td><td>		<span class="php-var">$this</span>-&gt;load-&gt;model(<span class="php-str">&#039;customer/custom_field&#039;</span>);</td></tr><tr id="1509" class="source-line"><td><a class="source-lineNum" href="#1509">1509: </a></td><td></td></tr><tr id="1510" class="source-line"><td><a class="source-lineNum" href="#1510">1510: </a></td><td>		<span class="php-var">$custom_fields</span> = <span class="php-var">$this</span>-&gt;model_customer_custom_field-&gt;getCustomFields([<span class="php-str">&#039;filter_customer_group_id&#039;</span> =&gt; <span class="php-var">$customer_group_id</span>]);</td></tr><tr id="1511" class="source-line"><td><a class="source-lineNum" href="#1511">1511: </a></td><td></td></tr><tr id="1512" class="source-line"><td><a class="source-lineNum" href="#1512">1512: </a></td><td>		<span class="php-kw">foreach</span> (<span class="php-var">$custom_fields</span> <span class="php-kw">as</span> <span class="php-var">$custom_field</span>) {</td></tr><tr id="1513" class="source-line"><td><a class="source-lineNum" href="#1513">1513: </a></td><td>			<span class="php-var">$json</span>[] = [</td></tr><tr id="1514" class="source-line"><td><a class="source-lineNum" href="#1514">1514: </a></td><td>				<span class="php-str">&#039;custom_field_id&#039;</span> =&gt; <span class="php-var">$custom_field</span>[<span class="php-str">&#039;custom_field_id&#039;</span>],</td></tr><tr id="1515" class="source-line"><td><a class="source-lineNum" href="#1515">1515: </a></td><td>				<span class="php-str">&#039;required&#039;</span>        =&gt; <span class="php-kw">empty</span>(<span class="php-var">$custom_field</span>[<span class="php-str">&#039;required&#039;</span>]) || <span class="php-var">$custom_field</span>[<span class="php-str">&#039;required&#039;</span>] == <span class="php-num">0</span> ? <span class="php-kw">false</span> : <span class="php-kw">true</span></td></tr><tr id="1516" class="source-line"><td><a class="source-lineNum" href="#1516">1516: </a></td><td>			];</td></tr><tr id="1517" class="source-line"><td><a class="source-lineNum" href="#1517">1517: </a></td><td>		}</td></tr><tr id="1518" class="source-line"><td><a class="source-lineNum" href="#1518">1518: </a></td><td></td></tr><tr id="1519" class="source-line"><td><a class="source-lineNum" href="#1519">1519: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;addHeader(<span class="php-str">&#039;Content-Type: application/json&#039;</span>);</td></tr><tr id="1520" class="source-line"><td><a class="source-lineNum" href="#1520">1520: </a></td><td>		<span class="php-var">$this</span>-&gt;response-&gt;setOutput(json_encode(<span class="php-var">$json</span>));</td></tr><tr id="1521" class="source-line"><td><a class="source-lineNum" href="#1521">1521: </a></td><td>	}</td></tr><tr id="1522" class="source-line"><td><a class="source-lineNum" href="#1522">1522: </a></td><td>}</td></tr><tr id="1523" class="source-line"><td><a class="source-lineNum" href="#1523">1523: </a></td><td></td></tr></table>
		</div>

		<div class="layout-footer">
			OpenCart API API documentation generated by <a href="https://www.apigen.org">ApiGen dev-master</a>
		</div>
	</div>

	<div class="layout-rest">
		<div class="navbar"></div>
	</div>
</body>
</html>
